Board index » delphi » If TableBusy then Don't Enter....(Help)

If TableBusy then Don't Enter....(Help)

I am trying to solve a problem that I am not sure I understand, but
here goes.

If a table is being used somewhere (like another form in my
applicaton) I do not want to allow the user to open another form that
uses the table.  Unless I do anything I get an EDBEngineError
exception with the message "Table is busy".   Now if I set the table
component to exclusive then based on what the help tells be the
exception just causes the program to wait till it is available.  This
is not what I want, I do not want to enter the form at all.

Can anybody help?


Jeff Zeanah
Z Solutions, LLC        ~
Atlanta, Georgia USA
Z Solutions' web page features:
"An Introduction to Neural Networks"


Re:If TableBusy then Don't Enter....(Help)


Ideally what you want is something to tell you if the table is locked. I
am not sure if you can get that (but look around... ya never know).

What you CAN do in the interrum (couple of suggestions):

1. Create a TStringList variable that holds a list of the tables your
forms are currently using. Consult that list before activating any forms
and check for tables that that form wants to open. Obviously, it is VERY
important that you remove tables from the list when the form that had it
open no longer needs it. Make this variable visible to all of your forms
(either by placing it on a hidden panel or passing it along to forms as
you open them or half a dozen other ways that I don't even know about yet
:)  ).

2.  Do not give them the option to open the other forms. Grey out what
they hit to open the other forms until the first form is closed.

Hope this sparks some ideas,

Other Threads