Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access
Message
De
16/11/2001 01:06:28
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australie
 
 
À
15/11/2001 04:36:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Re: Access
Divers
Thread ID:
00581281
Message ID:
00582576
Vues:
23
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform