Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Please, Help me. I am really LOST

Please, Help me. I am really LOST

Scheduled Pinned Locked Moved Database
helpdatabaseannouncement
11 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alexvw
    wrote on last edited by
    #1

    First of all: HAPPY NEW YEAR TO YOU ALL. The following code executed ONCE and it works just fine. But it fails for subsequent calls, given the following error msg: “No Transaction in Active”. Private Sub Update_Account() Dim T_OwnRec, A_OwnRec, P_OwnRec As Boolean T_OwnRec = Data.Get_TCount A_OwnRec = Data.Get_ACount P_OwnRec = Data.Get_PCount Try '****ERROR Data.Con.BeginTrans() '****ERROR If Update_All(T_OwnRec, A_OwnRec, P_OwnRec) = True Then Data.Con.CommitTrans() Trigger_Thread2LoadTags() Else Data.Con.RollbackTrans() MiniMe = False MsgBox("The Account could not be updated!!!", MsgBoxStyle.Information, "Unexpected error at:" & t_Str) MiniMe = True End If Catch Data.Con.RollbackTrans() Handle_Error(Err, "Update_Account") End Try End Sub The error is generated at the "Data.Con.BeginTrans". CAN ANYBODY OFFER SOME HELP. THANKS A LOT GUYS/GIRLS :) A VERY LOST NEW GUY :)

    C S 2 Replies Last reply
    0
    • A alexvw

      First of all: HAPPY NEW YEAR TO YOU ALL. The following code executed ONCE and it works just fine. But it fails for subsequent calls, given the following error msg: “No Transaction in Active”. Private Sub Update_Account() Dim T_OwnRec, A_OwnRec, P_OwnRec As Boolean T_OwnRec = Data.Get_TCount A_OwnRec = Data.Get_ACount P_OwnRec = Data.Get_PCount Try '****ERROR Data.Con.BeginTrans() '****ERROR If Update_All(T_OwnRec, A_OwnRec, P_OwnRec) = True Then Data.Con.CommitTrans() Trigger_Thread2LoadTags() Else Data.Con.RollbackTrans() MiniMe = False MsgBox("The Account could not be updated!!!", MsgBoxStyle.Information, "Unexpected error at:" & t_Str) MiniMe = True End If Catch Data.Con.RollbackTrans() Handle_Error(Err, "Update_Account") End Try End Sub The error is generated at the "Data.Con.BeginTrans". CAN ANYBODY OFFER SOME HELP. THANKS A LOT GUYS/GIRLS :) A VERY LOST NEW GUY :)

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      I'm confused. What technologies are you using? ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

      A 2 Replies Last reply
      0
      • A alexvw

        First of all: HAPPY NEW YEAR TO YOU ALL. The following code executed ONCE and it works just fine. But it fails for subsequent calls, given the following error msg: “No Transaction in Active”. Private Sub Update_Account() Dim T_OwnRec, A_OwnRec, P_OwnRec As Boolean T_OwnRec = Data.Get_TCount A_OwnRec = Data.Get_ACount P_OwnRec = Data.Get_PCount Try '****ERROR Data.Con.BeginTrans() '****ERROR If Update_All(T_OwnRec, A_OwnRec, P_OwnRec) = True Then Data.Con.CommitTrans() Trigger_Thread2LoadTags() Else Data.Con.RollbackTrans() MiniMe = False MsgBox("The Account could not be updated!!!", MsgBoxStyle.Information, "Unexpected error at:" & t_Str) MiniMe = True End If Catch Data.Con.RollbackTrans() Handle_Error(Err, "Update_Account") End Try End Sub The error is generated at the "Data.Con.BeginTrans". CAN ANYBODY OFFER SOME HELP. THANKS A LOT GUYS/GIRLS :) A VERY LOST NEW GUY :)

        S Offline
        S Offline
        S Akif Kamal
        wrote on last edited by
        #3

        Check the state of the connection. A transaction cannot be initiated with the state of the connection other than OPEN. Happy new year to all of u Akif

        A 2 Replies Last reply
        0
        • C Colin Angus Mackay

          I'm confused. What technologies are you using? ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

          A Offline
          A Offline
          alexvw
          wrote on last edited by
          #4

          I am "trying" to code using VB.Net and ADO.

          C 1 Reply Last reply
          0
          • S S Akif Kamal

            Check the state of the connection. A transaction cannot be initiated with the state of the connection other than OPEN. Happy new year to all of u Akif

            A Offline
            A Offline
            alexvw
            wrote on last edited by
            #5

            Unfortunately the Connection is OPEN, I am able to execute other commands through my app.

            1 Reply Last reply
            0
            • S S Akif Kamal

              Check the state of the connection. A transaction cannot be initiated with the state of the connection other than OPEN. Happy new year to all of u Akif

              A Offline
              A Offline
              alexvw
              wrote on last edited by
              #6

              Hi Guys, first of all Thanks for offering help. I found out what was causing the error (still do not understand why). The three top variables are being loaded by running queries and each function is supposed to return TRUE/FALSE (they do). I understood that Local Variables (within subs or functions) were automatically disposed off, once the focus leaves the sub or function. But my Local Recordsets are not being disposed off, and for some reason that goes beyond my little knowledge is preventing me from starting a Transaction. this is weird. Because I am not hardcoding the dispossal of any of my local variables at all, and this is the only piece of code that generates this error. Once again. Thank you guys for offering your help. HAVE A VERY HAPPY NEW YEAR Alex. (STILL A VERY LOST NEW GUY) :)

              C R S 3 Replies Last reply
              0
              • C Colin Angus Mackay

                I'm confused. What technologies are you using? ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

                A Offline
                A Offline
                alexvw
                wrote on last edited by
                #7

                Hi Guys, first of all Thanks for offering help. I found out what was causing the error (still do not understand why). The three top variables are being loaded by running queries and each function is supposed to return TRUE/FALSE (they do). I understood that Local Variables (within subs or functions) were automatically disposed off, once the focus leaves the sub or function. But my Local Recordsets are not being disposed off, and for some reason that goes beyond my little knowledge is preventing me from starting a Transaction. this is weird. Because I am not hardcoding the dispossal of any of my local variables at all, and this is the only piece of code that generates this error. Once again. Thank you guys for offering your help. HAVE A VERY HAPPY NEW YEAR. Alex. (STILL A VERY LOST NEW GUY) :)

                1 Reply Last reply
                0
                • A alexvw

                  I am "trying" to code using VB.Net and ADO.

                  C Offline
                  C Offline
                  Colin Angus Mackay
                  wrote on last edited by
                  #8

                  alexvw wrote:

                  I am "trying" to code using VB.Net and ADO.

                  That's what is confusing. ADO.NET has BeginTransaction, not BeginTrans. (I'm assuming SQL Server on the back end, because you didn't fully answer my question) ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

                  1 Reply Last reply
                  0
                  • A alexvw

                    Hi Guys, first of all Thanks for offering help. I found out what was causing the error (still do not understand why). The three top variables are being loaded by running queries and each function is supposed to return TRUE/FALSE (they do). I understood that Local Variables (within subs or functions) were automatically disposed off, once the focus leaves the sub or function. But my Local Recordsets are not being disposed off, and for some reason that goes beyond my little knowledge is preventing me from starting a Transaction. this is weird. Because I am not hardcoding the dispossal of any of my local variables at all, and this is the only piece of code that generates this error. Once again. Thank you guys for offering your help. HAVE A VERY HAPPY NEW YEAR Alex. (STILL A VERY LOST NEW GUY) :)

                    C Offline
                    C Offline
                    Colin Angus Mackay
                    wrote on last edited by
                    #9

                    alexvw wrote:

                    Recordsets

                    :confused: ADO**.NET** does not have recordsets. Classic ADO does. You should be using ADO.NET. This may be an incompatibility issue. ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

                    1 Reply Last reply
                    0
                    • A alexvw

                      Hi Guys, first of all Thanks for offering help. I found out what was causing the error (still do not understand why). The three top variables are being loaded by running queries and each function is supposed to return TRUE/FALSE (they do). I understood that Local Variables (within subs or functions) were automatically disposed off, once the focus leaves the sub or function. But my Local Recordsets are not being disposed off, and for some reason that goes beyond my little knowledge is preventing me from starting a Transaction. this is weird. Because I am not hardcoding the dispossal of any of my local variables at all, and this is the only piece of code that generates this error. Once again. Thank you guys for offering your help. HAVE A VERY HAPPY NEW YEAR Alex. (STILL A VERY LOST NEW GUY) :)

                      R Offline
                      R Offline
                      Rob Graham
                      wrote on last edited by
                      #10

                      As Colin said, you should be using ADO.NET, not classic ADO. The reason your recordsets are not being disposed is that they are not managed objects, but wrappers around COM objects (whose lifetime you must manage yourself). ADO.NET is supported by the System.Data.Oledb namespace in .NET. Absolute faith corrupts as absolutely as absolute power Eric Hoffer All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke

                      1 Reply Last reply
                      0
                      • A alexvw

                        Hi Guys, first of all Thanks for offering help. I found out what was causing the error (still do not understand why). The three top variables are being loaded by running queries and each function is supposed to return TRUE/FALSE (they do). I understood that Local Variables (within subs or functions) were automatically disposed off, once the focus leaves the sub or function. But my Local Recordsets are not being disposed off, and for some reason that goes beyond my little knowledge is preventing me from starting a Transaction. this is weird. Because I am not hardcoding the dispossal of any of my local variables at all, and this is the only piece of code that generates this error. Once again. Thank you guys for offering your help. HAVE A VERY HAPPY NEW YEAR Alex. (STILL A VERY LOST NEW GUY) :)

                        S Offline
                        S Offline
                        S Akif Kamal
                        wrote on last edited by
                        #11

                        What do u mean by recordset here. Is it traditional recordset of ADO or u r talking abt DataReader of ADO.Net. Plz give the details of "Data" or atleast "Data.Get_TAccount" Akif

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups