Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Save the date of the last data save...
Message
 
To
16/07/1999 17:45:03
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00242612
Message ID:
00242654
Views:
23
Mike,
What I've done is update the lDate field when ANY field is updated. I put the code in the Interactive Change event. It works the same as code that enables SAVE/CANCEL buttons when any field is updated.

The code in SAVE isn't used at all - it's just one more field to be updated during the SAVE.

I have subclassed controls that handle this. If I don't need to update the date stamp for certain fields these controls have their 'timestamp' property set to F and the code doesn't run.

I'm not sure what you are asking about your SAVE code - it looks like it'll run through all the cursors. I HAVE found that the '2' parameter in TableUpdate() doesn't always return the correct value.

>I want to save the date (an maybe time) of the last time a User modified data in my app. So in my save procedure I determine if the any field in the record has been changed. Then I save the current date to the to the ldate field in my tables. There also is an fdate field where the default value is date().
>
>My question is : is this a kosher way of doing things? Also, I only want to save the date if a any one field has been changed, I thought this seemed obvious but I havn't been getting the results I wanted. The current save code on my DE forms looks something like:
>
>
local llSaved, ;
>	laTables[1], ;
>	lnCursor, ;
>	lcAlias
>begin transaction
>llSaved = .T.
>for lnCursor = 1 to aused(laTables)
>	lcAlias = laTables[lnCursor, 1]
>	if cursorgetprop('Buffering', lcAlias) > DB_BUFOFF
>		llSaved = tableupdate(2, .F., lcAlias)
>		if not llSaved
>			exit
>		endif not llSaved
>	endif cursorgetprop('Buffering', lcAlias) > DB_BUFOFF
>next lnI
>
>if llSaved
>	end transaction
>	This.oForm.GoRecord(recno())
>else
>	rollback && and some more error stuff
>
>endif llSaved
>return llSaved
>
>Any input would be real usefull.
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform