geebee
Posts: 21
|
Posted: 07/24/2007, 4:00 PM |
|
Codecharge 3.102
Access DB
ASP NET VB
Hi,
I have added a DateTime field to my database, which updates every time a record is updated. I want to check this value before updating the database to ensure that userA has not updated the record while userB is making changes to the same record. I have tried to implement a DLookup in the Before Execute Update but without success. Can anyone help with this as I am lost.
Graham
|
|
|
geebee
Posts: 21
|
Posted: 07/28/2007, 7:59 AM |
|
Ok, this is what I used, along with a hidden control and a bit of javascript.
Placed in the OnValidate Row event - it seems to be working ok but I will continue to test.
Dim Clock as Integer = clock_no.value
Dim CheckDate As Date = Settings.Connection1DataAccessObject.ExecuteScalar("SELECT (Amended) FROM Employees WHERE (Clock_No) ="& Clock)
If hidden1.Value <> CheckDate Then
errors.Add("Database","This record has been updated by another user - Please reload the screen and try again.")
End if
|
|
|
|