BeginTrans/CommitTrans Error


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: BeginTrans/CommitTrans Error

  1. #1
    Join Date
    Jul 2004
    Posts
    143

    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

  2. #2
    Join Date
    Apr 2004
    Location
    New York City
    Posts
    538
    What's the error message?

  3. #3
    Join Date
    Jul 2004
    Posts
    143
    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.
    Attached Files Attached Files

  4. #4
    Join Date
    Apr 2004
    Location
    New York City
    Posts
    538
    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

  5. #5
    Join Date
    Jul 2004
    Posts
    143
    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.

Similar Threads

  1. Writing in HKEY_LOCAL_MACHINE...Access is denied
    By Martin in forum VB Classic
    Replies: 22
    Last Post: 12-03-2001, 04:53 AM
  2. Returning errors from SQL Server Stored Procs
    By Khalizan in forum VB Classic
    Replies: 1
    Last Post: 11-28-2001, 02:32 AM
  3. Re: Error handling in components called from ASP
    By James Barbetti in forum ASP.NET
    Replies: 2
    Last Post: 11-06-2001, 02:13 PM
  4. DTS/linked server error #6
    By John M. in forum Database
    Replies: 0
    Last Post: 05-17-2001, 04:01 PM
  5. Winsock32, Connect fails to connect to a peer
    By Chris.G in forum VB Classic
    Replies: 4
    Last Post: 11-13-2000, 04:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center