Link to home
Start Free TrialLog in
Avatar of chachote
chachote

asked on

Easy DB Question

How can I bypass the lock state of a Record? I mean, sometimes I get a "RecordLockedByAnotherUser" error and there's no way to change that record until I restart windows.

How can I unlock it:
a)At design time?
b)At run time?
Avatar of rwilson032697
rwilson032697

Listening
Hi
the only way i know that sometimes works is too close delphi and any other bde application that is open and then restart Delphi ,that should clear the lock.

Regards Barry
From the BDE help file:

Release the record lock on either the current record or all the record locks in the current session.

This example uses the following input:

  fDbiRelRecordLock(Table1.Handle, True);

The procedure is:

procedure fDbiRelRecordLock(hTmpHandle:hDBICur; bAll: Boolean);

begin
  Check(DbiRelRecordLock(hTmpHandle, bAll));
end;
listen
Is it only at design time has this problem?  
Avatar of chachote

ASKER

DrDelhpi looks like you're close but
what about when coding/debugging?
¿How can I break the Lock from within delphi?
Chachote,
  To tell you the truth, I don't think that it's possible in Designtime. While debugging, you could always set a breakpoint, make a call to the function I mentioned and then check your values.


Good luck!!
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

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
Thanks to all of you who answered!
I got another question ¿why don't you see it and earn more points?