OrthoDocSoft
Programmer
Dear folks,
FYI: Using Access 2000 format.
I have a VB6 application which resides on multiple computers, all of which "point" to the same database on a client's network, and update it frequently. This is still in development, and I am beginning to notice errors like this:
"Jet stopped because two different programs tried to update record at the same time."
The way this app is written makes it so this CAN be true, since all of the copies of this application on the network write to the one DB.
How do I "lock" the database by one copy of the application, so that other copies have to "wait" until the first copy is finished updating, before the other copies can update in their turn?
In pseudocode, I'm looking for something like
If all instances of this application had that bit whenever they tried to update, it would seem updating would be orderly and I wouldn't get update "collisions."
Any suggestions?
Thanks,
Ortho
"you cain't fix 'stupid'...
FYI: Using Access 2000 format.
I have a VB6 application which resides on multiple computers, all of which "point" to the same database on a client's network, and update it frequently. This is still in development, and I am beginning to notice errors like this:
"Jet stopped because two different programs tried to update record at the same time."
The way this app is written makes it so this CAN be true, since all of the copies of this application on the network write to the one DB.
How do I "lock" the database by one copy of the application, so that other copies have to "wait" until the first copy is finished updating, before the other copies can update in their turn?
In pseudocode, I'm looking for something like
Code:
While MyDatabase.InUse = "True" then
'wait until db gets clear
wend
MyDataBase.Update
If all instances of this application had that bit whenever they tried to update, it would seem updating would be orderly and I wouldn't get update "collisions."
Any suggestions?
Thanks,
Ortho
![[lookaround] [lookaround] [lookaround]](/data/assets/smilies/lookaround.gif)