Access & Transaction ?

J

Josh Grameson

Is the Transaction (BeginTransaction/Commit/Rollback) in Access related to a
Workspace?

If so can I have more than one workspace open at once, one of them in a
Transaction and one of them not?
 
G

Guest

If so can I have more than one workspace open at once, one of them in a
Transaction and one of them not?

Yes.

ODBC transactions are actually connection based, not workspace based,
and I've never checked to see if that works correctly, but for mdb's it
works
ok.

It used to be that forms and Access were in the default workspace (0),
so creating a separate workspace allowed you to crash the transaction
without causing problems to your forms and application window, but
I don't know if that is still true.

(david)
 
G

Graham R Seach

Josh,

Yes, the Jet transaction is at Workspace level.

And yes, you can open more than one Workspace and have one with transactions
and the other not. Any transactions opened against one Workspace will be
completely isolated from those opened against another.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
J

Josh Grameson

Hi Graham,

Thanks so much for your reply.

I have been trying to do this but I can't get the syntax right. Any chance
you can send me an example of how to do this. I have only been successful in
doing
dbengine.currentdb.

thanks
 
G

Graham R Seach

Josh,

CurrentDb() is a function that returns an instance of the current Database -
not the Workspace. CurrentDb() belongs to the default Workspace.

To create an instance of the default workspace, and to create an instance of
a new Workspace, see the following code segment.

Dim ws1 As DAO.Workspace
Dim ws2 As DAO.Workspace

Set ws1 = DBEngine(0) 'The default Workspace
Set ws2 = DBEngine.CreateWorkspace("myWorkspace", "", "", dbUseJet)

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 

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