Difference between DBEngine.BeginTrans and DBEngine.Workspaces(0).BeginTrans

calendar_today Asked Jan 7, 2009
thumb_up 7 upvotes
history Updated April 16, 2026

Question posted 2009 · +6 upvotes

In Access, what is the difference between these two statements?

DBEngine.BeginTrans

and

DBEngine.Workspaces(0).BeginTrans

The documentation for both leads to the same place.

Accepted answer +7 upvotes

Have a look here: DAO Workspace
And then here: DAO Workspace: Opening a Separate Transaction Space

(The links are for MFC, but they’re applicable to whatever you’re coding in.)

DBEngine.Workspaces(0) is the default workspace. Other workspaces can be created, which let you work with separate sessions; the idea is that BeginTrans and EndTrans apply to the whole workspace, but if you need to do stuff outside that transaction, you can create another workspace and use it independently of your transactions in the first workspace.

Personally, I never had occasion to use more than one workspace when doing DAO in VBA. * shrug *

Top ms-access Q&A (6)

+7 upvotes ranks this answer #37 out of 55 ms-access solutions on this site .