BeginTrans/CommitTrans Error
I have a VB6 app that does a SELECT to determine if there any rows that need to be processed. When there are I need to wrap the executes inside the loop with the BeginTrans and CommitTrans. Problem is when I get done and the commit is complete I do a MoveNext as the last statement in the loop (after the commit) and I get an error. Since the INSERTS worked (I can see them in the table) why the error when I issue the MoveNext on the
Do While SLSalesOrder_Tb.EOF = False
if that is outside the Trans?
Thanks
[523 byte] By [
Don] at [2007-11-11 7:35:43]

# 2 Re: BeginTrans/CommitTrans Error
The error I get in the logging process is
"01-03-200615:49:28 SQL Error Error Number: -2147418113 Description: Catastrophic failure Source: Microsoft OLE DB Provider for ODBC Drivers SQL State: Native Error: 0"
Note that the transactions did get updated and inserted as expected. I don't know why this error. I have attached the actual code which runs with no errors if the begin and commit are removed. If I move them around I get similar errors.
Don at 2007-11-11 17:27:51 >

# 3 Re: BeginTrans/CommitTrans Error
I just took a REALLY quick look at your code - there's a lot there! Are you sure you're not closing SLSalesOrder_Tb before trying to MoveNext? It's a bit confusing trying to read the code with all the commented out lines;-)
Is this error happening when you run the code exactly as you uploaded it?
What is your backend database? I have heard of this same error occurring when accessing a MySQL db using VB6 and ADO. The fix was to download the latest version of the MyODBC driver.
-Andrew
# 4 Re: BeginTrans/CommitTrans Error
I am using SQL Server 2K. The code flows just fine if I take out the trans instructions. Basically I just need it to commit to the INSERTS. I moved the begin higher as when I had it right before the first INSERT it did not like that at all.
Don at 2007-11-11 17:29:51 >
