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?
chachoteAsked:
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.

rwilson032697Commented:
Listening
0
intheCommented:
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
0
DrDelphiCommented:
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;
0
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

yk030299Commented:
listen
0
SupWangCommented:
Is it only at design time has this problem?  
0
chachoteAuthor Commented:
DrDelhpi looks like you're close but
what about when coding/debugging?
¿How can I break the Lock from within delphi?
0
DrDelphiCommented:
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!!
0
kretzschmarCommented:
hi chachote,

just set all dataset-propertys active to false at designtime, open the dataset on app-start, ex. in the create-event of your mainform. this will avoid locking-failures during debugging.

also do never with open datasets use during debugging the option RUN|Program Reset in delphi. this may cause in a hanging lock. if you use paradox in this case, delete the *.lck files in the database dir.

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