Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 When use Begin,Comment, Rollback Transaction

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-10-22 : 08:33:24
Malik writes "A simple Code:
Recordset1 Opened
Recordset1 get 10 records
Begin Transaction
Execute Delte Queries (TOTAL DIFFERENT TABLES)
Comment Transaction

When try to access information of Recorset1 then recordcount=0
Message appears:
Run time error '-2147418113'
ITransaction::Commit or ITransaction::Abort was called and
object is in a zombie state.

Environment: VB/SQL Server 2000/ADO - OLE DB
"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-22 : 08:44:50
Is recordset1 used inside the transaction? It not a good idea to open objects outside a transaction where you'll use them. Secondly, ADO transactions are far less desirable than using native SQL Server transactions in a procedure. You can almost certainly rewrite your SQL as a procedure and put the transaction there instead. Take a look here:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=20748

Before you reply "I can't change the code" please post the EXACT code you're using now, and what you need the transaction to do.

Go to Top of Page
   

- Advertisement -