All fields suddenly reads #DELETED when accesing a record from two sessions at once

Inkognito

Registered User.
Local time
Yesterday, 18:04
Joined
Apr 4, 2008
Messages
43
Hi there!

I have a scary problem, I have just redesigned my database for supporting multiple users.
I am currently in the test-phase, where I simply open the database twice (hereby refered to as two sessions), and then I try to produce errors by typing in data in the same records at once.

I have hooked all the error messages and created custom procedures for them, and it is mostly working very well.
Unless a few times, in one of the sessions, every field suddenly reads #DELETED (or possible #erased etc, I have norwegian access).

The other session can still read this record perfectly, but I have to reopen the first session to regain access to that specific record.
The error appears in a few different circumstances, but mainly when both sessions is viewing the same record, and I type in some info in one of the sessions and save the record, and then set focus to the same field in the other session. The record becomes invalid, but only in one session.
I can't always reproduce the error though, as it doesn't always happen.

I think the problem is that the form sometimes updates is data without the user asking for it. And then it might crash somehow. I wish there was a way to force the form to never update the data unless asked to do so by the update button (or the user changes records back and forth). Then my subroutines would run, and any crash would be prevented.
 
Last edited:
Why are you trying to edit the same record on multiple logins? By design this would be an unwanted situation. Usually only one person can lock the record and change its contents.

Still, if you want this behaviour use an unbound form and check every field that was changed by person1 and person2. Create an update statement to reflect this. This is when users may not edit each others fields.

If both persons can edit the same field use a datetime field to store the last timestamp the record was changed. If the record was saved in the time you where editting the same record, the timestamp of the changed record will be different than the one you are editting.
This is what your update query should like more of less:
Code:
update table1 set field1='New Value', LastChanged = now() where LastChanged = #01-01-2010 14:32:28# and Id = 321
HTH:D
 

Users who are viewing this thread

Back
Top Bottom