Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Commit Trans

Status
Not open for further replies.

JLR1234

Programmer
Jul 23, 2004
20
US
I can't figure this out.

I have a VB6 application writing to an SQL Server 2005 database. At one point in the application, I delete an invoice. This function touches multiple tables using select, update and delete commands. The code is surrounded by BeginTrans and CommitTrans. I don't receive ANY error messages when stepping through the code. After the function completes, the changes have not been made. It's as if the transactions are not committed.

If I remove the begintrans and committrans lines, the transactions do actually occur in the database properly.

Here's the crazy thing... this EXACT code works properly when writing to an SQL Server 2000 database instead of 2005.

Any thoughts?

 
I tested another database and the code doesn't work on an SQL Server 2000 database either. So, I still don't understand why the transactions won't commit...
 
I found the problem. When I ran the code through SQL Server directly, I received an error message on a select statement. VB did not throw an error when it was run through VB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top