From: Bernard Bout
To: Rob Vleeschhouwer
Visual FoxPro 9
Databases, Tables and SQL Server
Sunday, August 13, 2006 3:33:47 AM
This message was rated by:
> In VFP the function UPDATED() is not longer supported. What I have done to see if a record was changed, is compare, in a loop, each field in that record with the OLDVAL() of that record. There must be a better way. And how can I see if a table is changed. P.e. a grid representing a salesorder.
There certainly is. Use the method VFP Cursor Adapters use.
Check out GETFLDSTATE()
You can specify –1 for nFieldNumber to return a character string consisting of deletion and modification status values for all fields in the table or cursor. For example, if a table has five fields and only the first field has been changed, GETFLDSTATE( ) returns 121111. The 1 in the first position indicates the deletion status has not been changed.
But "2" shows that field 1 has been changed.
111211 means that field 3 has been changed.
2111211 means that the record has been DELETED and field 4 has been changed.
Just check the string returned. If all are 1's then no change.
Posted by Rob @ 8/13/2006 12:37:16 AM
Posted by Bernard Bout @ 8/13/2006 3:33:47 AM