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)
- How can I modify a saved Microsoft Access 2007 or 2010 Import Specification? +31 (2008)
- OleDbCommand parameters order and priority +28 (2009)
- Is there an equivalent to the SUBSTRING function in MS Access SQL? +26 (2009)
- What do I need to read Microsoft Access databases using Python? +25 (2009)
- MS Access library for python +24 (2009)
- is there any replacement of Access? +21 (2009)
ms-access solutions on this site
.