Hi E C,
Have a look at BeginTrans, RollbackTrans and CommitTrans in the Access VBA Help.
You could do something like:
oDatabaseConnection.BeginTrans
IF anerrorhasoccurred
oDatabaseConnection.RollbackTrans
ELSE
oDatabaseConnection.CommitTrans
ENDIF
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.