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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top