Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine data changed in table (not record)

Status
Not open for further replies.

Walker

Programmer
Feb 24, 2000
2
US
I need a function that will tell me if any data has changed in a TABLE or CURSOR.
The GETFLDSTATE( ) function is limited to a record.
Is there a similar function for table changes? If not, any clever alternatives?
[sig][/sig]
 
=adir() - Column5 or
= fdate() or
= ftime() or
= lupdate() or
[tt]
create a table "dbfalter" with 2 fields dbfname (c,20) datetime (datetime)
index on dbfname tag dbfname

procedure checkdbfalter
lcalias=alias()
if !used("DBFALTER")
use dbfalter order dbfname in 0
endif
llreturn = .f.
if seek(lcalias , "DBFALTER")
if DBFALTER.DATETIME != fdate(lcAlias+".dbf" , 1)
replace DBFALTER.DATETIME with fdate(lcAlias+".dbf" , 1)
llreturn = .t.
endif
else
select DBFALTER
append blank
replace DBFALTER.DBFNAME with lcAlias, DBFALTER.DATETIME with fdate(lcAlias+".dbf" , 1)
select (lcAlias)
llreturn = .t.
endif
return llreturn
endproc
[/tt]
There may be about 10 other ways but this is the first thing that came to mine (as if I have one) [sig]<p>David W. Grewe<br><a href=mailto:Dave@internationalbid.net>Dave@internationalbid.net</a><br><a href= > </a><br> [/sig]
 
Dave's suggestion is pretty good, and one that didn't immediately come to my mind, but would work if the changes were flushed to disk.

Walker, I think what you need is GetNextModified(). You'll need to have table buffering turned on to use it. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Opps, I forgot, some people open databases with an alias not the same as the database name and may not have a path set.
Replace fdate(lcAlias+&quot;.dbf&quot; , 1)
with fdate(dbf() , 1) [sig]<p>David W. Grewe<br><a href=mailto:Dave@internationalbid.net>Dave@internationalbid.net</a><br><a href= > </a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top