transaction and rollback

S

Souris

I use MS Access 2003 version.

I would like to know does MS Access 2003 support Transaction, commit and
rollback?

Your information is great appreciated,
 
S

Souris

Thanks for the message,

The example uses db.execute strMySQL

My function uses Docmd.RunSQL strMySQL

Do I need change it to db.execute to support rollback transaction?

If yes, can I pass db and ws to a function to do db.execute and start
transaction and rollback or commit in the calling function?

Thanks millions,
 
A

Allen Browne

Yes: you must use Execute (not RunSQL) for a transaction.

Yes: you can pass ws to the function, and then in the function derive db
from that. The function declaration would look like this:
Function MyFunc(ws As DAO.Workspace)

Here's an example of calling a function that executes a SQL statement in a
transaction:
http://allenbrowne.com/func-DAO.html#ExecuteInTransaction

Here's an explanation on the differences between Execute and RunSQL:
http://allenbrowne.com/ser-60.html
 
S

Souris

Thanks millions,

Allen Browne said:
Yes: you must use Execute (not RunSQL) for a transaction.

Yes: you can pass ws to the function, and then in the function derive db
from that. The function declaration would look like this:
Function MyFunc(ws As DAO.Workspace)

Here's an example of calling a function that executes a SQL statement in a
transaction:
http://allenbrowne.com/func-DAO.html#ExecuteInTransaction

Here's an explanation on the differences between Execute and RunSQL:
http://allenbrowne.com/ser-60.html
 

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