Board index » delphi » How to lock a record when using updatesql

How to lock a record when using updatesql

When I using an Updatesql / specifing the onupdaterecord event
handler to update a query table, the records will not auto lock,
also then query will edit the record locked by other table/query
that does not using updatesql. Can someon help me to solve this
problem?

Thanks & Regards
Jack

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com

 

Re:How to lock a record when using updatesql


Quote
>also then query will edit the record locked by other table/query
>that does not using updatesql. Can someon help me to solve this
>problem?

Is this with Paradox?
Do you have local share set to true on all he workstations so BDE knows to use
network locking?

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

Re:How to lock a record when using updatesql


Brian, Thanks for your reply.

I am using Paradox Table with D4 and set the local to true.
All things works ok when i do not set the updateobject and
onupdaterecord event handler for the query detail.  But if i do,
the query will not lock the records which are being edit and
also will not check the reords is locked by other user or table.

and I had test this with the following

1. I use three Tquery objects.
2. Set the cache update to true
3. set all other property to same include the sql
4. I set the updateobject for query3, but do not set for qery1
and query2.

and test with the following code

query1.first;
query1.edit;
query3.first;
query3.edit;    // no error message is give and can continue to

query3.first;

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com

Re:How to lock a record when using updatesql


Brian, Thanks for your reply.

I am using Paradox Table with D4 and set the local to true.
All things works ok when i do not set the updateobject and
onupdaterecord event handler for the query detail.  But if i do,
the query will not lock the records which are being edit and
also will not check the reords is locked by other user or table.

and I had test this with the following

1. I use three Tquery objects.
2. Set the cache update to true
3. set all other property to same include the sql
4. I set the updateobject for query3, but do not set for qery1
and query2.

and test with the following code

query1.first;
query1.edit;
query3.first;
query3.edit;    // no error message is give and can continue to
                // to edit query3.
query2.first;
query2.edit;   // receive a message the the record is locked by
               // other user.
query1.close;
query3.close;
query3.open;
query3.first;
query3.edit;
query1.open;
query1.first;
query1.edit;  // also no error message is show that the record is
              // begin edit by other user.

Thanks
Jack

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com

Other Threads