CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Check Timestamp Before Update

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.