Link to home
Start Free TrialLog in
Avatar of fkmfkm
fkmfkm

asked on

Row locking in MS SQL 7

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

Thank you.
Avatar of Radler
Radler

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.
Avatar of fkmfkm

ASKER

Yes...

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


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

T++, Radler.
Avatar of fkmfkm

ASKER

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...

....
ASKER CERTIFIED SOLUTION
Avatar of Radler
Radler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial