Please, Help me. I am really LOST
-
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 :)
-
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 :)
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
-
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 :)
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
-
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
-
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
-
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
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) :)
-
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
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) :)
-
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
-
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) :)
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
-
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) :)
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
-
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) :)
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