Board index » delphi » Unlock Paradox Records

Unlock Paradox Records

I am using Paradox tables in a network application. I set up the
BDE as in the dox, with NET DIR and PATH pointing to the data
on the server, and LOCAL SHARE set to true.  This works great.
However, my client wants one workstation to be able to view
the data from a record that is open on another workstation.
(He is a doctor and he wants to snoop on what a medical tech
is doing at the time.) So, what is the best way to "unlock"
the record for only this one workstation?  I have played around
with changing the NET DIR on the workstation, but it just
generates errors on a Windows 2000 network. Thanks for any
advice!

 

Re:Unlock Paradox Records


The contents of a record that is in the process of being edited is not
be saved to disk until the record is posted.  A lock is held on the
record during the entire time the record is in edit-mode (pessimistic
locking...) so that no one else can change it.  Anyone who reads the
record will see the last posted copy (the "before" picture) of the
record.

When the user saves changes to the current record, the data is written
to disk and the record lock is removed.  Anyone who views the record
from that moment forward will see the new copy of the record.

No one can see changes "while they are being made," and this is a very
deliberate part of the design.

Quote
Ken Pfeiffer wrote:

> I am using Paradox tables in a network application. I set up the
> BDE as in the dox, with NET DIR and PATH pointing to the data
> on the server, and LOCAL SHARE set to true.  This works great.
> However, my client wants one workstation to be able to view
> the data from a record that is open on another workstation.
> (He is a doctor and he wants to snoop on what a medical tech
> is doing at the time.) So, what is the best way to "unlock"
> the record for only this one workstation?  I have played around
> with changing the NET DIR on the workstation, but it just
> generates errors on a Windows 2000 network. Thanks for any
> advice!

------------------------------------------------------------------
Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259
mailto:i...@sundialservices.com  (PGP public key available.)
Quote
> Fast(!), automatic table-repair with two clicks of the mouse!
> ChimneySweep(R):  "Click click, it's fixed!" {tm}
> http://www.sundialservices.com/products/chimneysweep

Re:Unlock Paradox Records


The record locks in Paradox are write locks. They do not prevent other users
from viewing the record. If the doctor wants to see changes that have not
been posted yet that is impossible because the changes only exist in memory
on the workstation where they are being made.

--
Bill

Re:Unlock Paradox Records


Quote
>This works great.
>However, my client wants one workstation to be able to view
>the data from a record that is open on another workstation.

Nothing in Paradox prevents you from viewing records open by other users.  You
can't see changes they have made to the record until they post those chages.
If the user posts changes to a record you are currently viewing you will have to
Call the Ttable.Refresh method to see those changes.
If you are using a Query you will have to rerun the query to see any changes to
the data since the last time you ran the query.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Unlock Paradox Records


My program creates a form that is attached to the database, and
puts the table into edit mode. When I try to open the data on
another workstation I get the error, "Cannot edit patient;
Record locked by another user".  So my question was how can
I avoid getting that error and let the program proceed?  The
program is very complex and I would rather not change all the
code that attempts to put the tables into edit mode. Is there
a way to simply get around the lock?

Brian Bushay TeamB <BBus...@Nmpls.com> wrote:

Quote

>>This works great.
>>However, my client wants one workstation to be able to view
>>the data from a record that is open on another workstation.

>Nothing in Paradox prevents you from viewing records open by other users.  You
>can't see changes they have made to the record until they post those chages.
>If the user posts changes to a record you are currently viewing you will have to
>Call the Ttable.Refresh method to see those changes.
>If you are using a Query you will have to rerun the query to see any changes to
>the data since the last time you ran the query.

>--
>Brian Bushay (TeamB)
>Bbus...@NMPLS.com

Re:Unlock Paradox Records


No, there is no way to get around the lock. If you could bypass the lock you
could easily corrupt the table. The solution is to not place the table in
Edit mode when all you want to do is view the record.

--
Bill

Re:Unlock Paradox Records


Quote
>another workstation I get the error, "Cannot edit patient;
>Record locked by another user".  So my question was

Only one person can edit a paradox record at any one time.
You code seems to automatically edit the selected record.  You can't do that and
you will have to change your code so at least the administrative version does
not put the record you select into Edit.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads