Board index » delphi » Locking a record while editing, how?????

Locking a record while editing, how?????

Hello,

I wonder If anyone has an answer to the following question:
Using Delphi3, with native access I want to lock a record, while
editing it, so no one else can change the record as long as I am
editing the record. How can you prevent other users from changing
the record currently in use.

In access 97 you can set an option (locking whole tables or just
records). If some one else tries to edit a locked record, he receives
an error message.

If I edit in an DBedit box a database record, and start the application
again
to create another instance, this instance can also make changes
in the same DBedit box as the original application. This differs from the
situation explained above. Ideally I would like to generate a message
stating 'User x is already editing this record' on the moment a user
tries to edit a record with a DBedit box which is already in use.

Any help would be much appretiated.

Kind regards,
E.J. Woerlee
woer...@kivi.nl

 

Re:Locking a record while editing, how?????


In article <01bc799c$0f1191c0$bb746cc3@bigtower>,
   "E.J. Woerlee" <woer...@KIvI.NL> wrote:

Quote
>Hello,

>I wonder If anyone has an answer to the following question:
>Using Delphi3, with native access I want to lock a record, while
>editing it, so no one else can change the record as long as I am
>editing the record. How can you prevent other users from changing
>the record currently in use.

>In access 97 you can set an option (locking whole tables or just
>records). If some one else tries to edit a locked record, he receives
>an error message.

>If I edit in an DBedit box a database record, and start the application
>again
>to create another instance, this instance can also make changes
>in the same DBedit box as the original application. This differs from the
>situation explained above. Ideally I would like to generate a message
>stating 'User x is already editing this record' on the moment a user
>tries to edit a record with a DBedit box which is already in use.

What database are you using? when I do this with Interbase, I get a locking
exception the instant the second instance tries to put the dataset into
edit mode.

--
Brad Aisa     web archive: http://www.interlog.com/~baisa/
email (anti-spam encoded): baisa"AT SYMBOL"interlog.com

"The highest responsibility of philosophers is to serve as the
guardians and integrators of human knowledge."   -- Ayn Rand

Re:Locking a record while editing, how?????


I use a access 97 datatabase, with Delphi 3. Locking is not supported
though...

Quote
> What database are you using? when I do this with Interbase, I get a
locking
> exception the instant the second instance tries to put the dataset into
> edit mode.

> --
> Brad Aisa     web archive: http://www.interlog.com/~baisa/
> email (anti-spam encoded): baisa"AT SYMBOL"interlog.com

> "The highest responsibility of philosophers is to serve as the
> guardians and integrators of human knowledge."   -- Ayn Rand

Other Threads