Page 1 of 1

Locking Help Needed

Posted: Mon 19 Jan 2009 03:02
by Rober Watson
I have a table of class registrations. Each class has a set limit of allowable registrations. Whenever a user desires to register for a class I want to insure the class is not full and then, if it is not, add them to the class registration role. I insure it is not full by counting all the registrations and then comparing to the allowable for the class. I need to lock the table to insure that no one else registers while I am counting and entering a new record. How do I best do this please??

mySQLQuery.Lock;
do my thing;
mySQLQuery.UnLock;
??????

TIA,
Bob Watson

Posted: Mon 19 Jan 2009 13:57
by Dimon
To solve the problem you should use the Lock or LockTable methods.
You can find more detailed information about these methods in the MyDAC help.