Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access
Message
From
16/11/2001 01:06:28
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
 
 
To
15/11/2001 04:36:42
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Re: Access
Miscellaneous
Thread ID:
00581281
Message ID:
00582576
Views:
21
Hi E C,

Have a look at BeginTrans, RollbackTrans and CommitTrans in the Access VBA Help.

You could do something like:
* ----- Begin Transaction
oDatabaseConnection.BeginTrans

* ----- Processing goes here

IF anerrorhasoccurred
    * ----- Rollback Transaction    
    oDatabaseConnection.RollbackTrans
ELSE
    * ----- Commit Transaction
    oDatabaseConnection.CommitTrans
ENDIF

* ---- Close tables and release object references
Hope this helps,
Gavin...

>Ha... I get it, thank you.
>
>oDC = CREATEOBJECT('ADODB.Connection')
>oDc.OPEN('provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Compaq\mex\mexdata.mdb;'+;
>'Jet oledb:system database=\\Compaq\mex\sysmex.mdw;user id=Admin;password=TEO')
>
>
>But 1 problem, how to deal with transaction? eg. If insert of the 2nd table fail, how can I rollback the 1st table insert?
>
>Thank u.
Previous
Reply
Map
View

Click here to load this message in the networking platform