Board index » delphi » record already locked

record already locked

I'm trying to edit a record in a dataset.  The form I have has a SQL off of
the dataset, the actual dataset is on another form.  I have tried to change
the SQL, but have been unsuccessful trying to change the actual record in
the dataset at the same time.  So I've tried another route.  I now use
'FindNearest' off the key field to find the actual record in the dataset.
After finding the correct record, I then try to edit/post to it.  It crashes
when it reaches the edit statement, saying "Record already locked by this
session".  I add a UnlockTable statement for the dataset, but then it says
"object not locked".  Any ideas on what I'm missing here???
 

Re:record already locked


Check the query to be sure you are returning a live result set. You
can not edit a query based on more than one table.

Woody

Quote
Bill Vanselow wrote in message <6vdquj$k...@forums.borland.com>...
>I'm trying to edit a record in a dataset.  The form I have has a SQL
off of
>the dataset, the actual dataset is on another form.  I have tried to
change
>the SQL, but have been unsuccessful trying to change the actual
record in
>the dataset at the same time.  So I've tried another route.  I now
use
>'FindNearest' off the key field to find the actual record in the
dataset.
>After finding the correct record, I then try to edit/post to it.  It
crashes
>when it reaches the edit statement, saying "Record already locked by
this
>session".  I add a UnlockTable statement for the dataset, but then it
says
>"object not locked".  Any ideas on what I'm missing here???

Re:record already locked


To edit a query result set it it must be live.  Make sure the RequestLive
property is set to True and that the query conforms to the rules for live
result sets in the on-line help.

UnlockTable will only release table level locks. It will not release record
locks. To release a record lock you must cancel the change or post the
record.

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Other Threads