Row locking in MS SQL 7

How can I lock a single Row using TQuery/TTable in MS SQL 7 ?

Thank you.
fkmfkmAsked:
Who is Participating?
 
RadlerConnect With a Mentor Commented:
Sorry friend, but the BDE doc's always said that pessimistic locking at SQL servers is not availble. So Refer to SQL Server doc's to see a specific API.

T++, Radler.
0
 
RadlerCommented:
I think that this work:

begin

MyDataSet.Edit;
//Make what I Want
MyDataSet.Cancel //Would be putted .Post if any changes are made.

End;

T++, Radler.
0
 
fkmfkmAuthor Commented:
Yes...

But what I want is a pesimistic lock .not optimistic lock...


Thank you
0
 
RadlerCommented:
Sory, but what is pessimistic/optmistic lock ?

T++, Radler.
0
 
fkmfkmAuthor Commented:
Because for SQL server, when u perform an edit it wont lock the record, instead it will just check whether anyone has modified the record; and just promt you if there is any..(optimistic)

For pessimistic lock, other user wont be able to edit the record which has been lock...

....
0
All Courses

From novice to tech pro — start learning today.