| | |
|
|
|
Re: transaction not working |
| message from Allen Browne on 5 May 2004 |
1. Set a Database variable *after* you open the transaction in your
workspace.
2. Use dbFailOnError so you hear about any issues.
3. Test the RecordsAffected so you know the record was written.
Result:
wks.CommitTrans
Set db = wks(0)
db.Execute "INSERT INTO ...", dbFailOnError
Debug.Print db.RecordsAffected & " record(s) written"
wks.CommmitTrans
More information on traps with transactions:
http://allenbrowne.com/ser-37.html
The warning about how you clean up is particularly relevant when you were
trying to keep a global db variable open.
|
| Ahmed replied to Allen Browne on 6 May 2004 |
At the launch of my database, i define wksLocal (workspace), and db
(database) as global variables. they are set also at the very beginning
(first wksLocal and then db !).
So i don't have to define another workspace in a specific sub i think. I
tried this way and it works...
Thank you M. Browne ;-)
"Allen Browne" <AllenBrowne@SeeSig.Invalid> a écrit dans le message de
news:4098df28$0$16586$5a62ac22@freenews.iinet.net.au...
|
|
Archived message: Re: transaction not working (MS Access Error Message)