markgrizzle
Programmer
Hi:
My Access 2003 application has a function which updates several sql server 2000 tables within a transaction.
I use an ADO connection for all data acess, and the connection's .Execute method for the sql statements.
Here's a sample
function foo()
LoadConnection
cnn.BeginTrans
blnTrans = True
sql = "Insert..."
cnn.Execute sql, iRecords, adExecuteNoRecords
If iRecords <> 1 Then
cnn.RollbackTrans
GoTo ExitHere
End If
sql = "Delete..."
cnn.Execute sql, iRecords, adExecuteNoRecords
If iRecords <> 1 Then
cnn.RollbackTrans
GoTo ExitHere
End If
cnn.CommitTrans
blnTrans = False
CloseConnection
End Function
I've been getting an error message at the cnn.Commit, telling me there isn't an active transaction.
My question is, do I need to use ado recordsets with transaction processing? Or is it something else causing the problem?
Thanks,
Mark
ps - If anyone knows of any existing threads discussing this problem, please point me to them.
My Access 2003 application has a function which updates several sql server 2000 tables within a transaction.
I use an ADO connection for all data acess, and the connection's .Execute method for the sql statements.
Here's a sample
function foo()
LoadConnection
cnn.BeginTrans
blnTrans = True
sql = "Insert..."
cnn.Execute sql, iRecords, adExecuteNoRecords
If iRecords <> 1 Then
cnn.RollbackTrans
GoTo ExitHere
End If
sql = "Delete..."
cnn.Execute sql, iRecords, adExecuteNoRecords
If iRecords <> 1 Then
cnn.RollbackTrans
GoTo ExitHere
End If
cnn.CommitTrans
blnTrans = False
CloseConnection
End Function
I've been getting an error message at the cnn.Commit, telling me there isn't an active transaction.
My question is, do I need to use ado recordsets with transaction processing? Or is it something else causing the problem?
Thanks,
Mark
ps - If anyone knows of any existing threads discussing this problem, please point me to them.