ADO Connections and transactions

M

mscertified

Why does the following code not work:

CurrentProject.Connection.BeginTrans
....
CurrentProject.Connection.CommitTrans

and yet this does:

Dim conn as new adodb.connection
set conn = CurrentProject.Connection
conn.BeginTrans
....
conn.CommitTrans
 
C

Chris O'C via AccessMonster.com

CurrentProject.Connection is a property, not a Connection object. You can't
support transactions for the CurrentProject until you instantiate a
Connection object and point that object to the CurrentProject's Connection
property.

Chris
Microsoft MVP
 
Top