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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
RadlerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.