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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

gathering updated records ?

Status
Not open for further replies.

pxw

Programmer
Jan 6, 2002
86
AU
hi,

Is there any way to gather all the updated records from a table easier?

I am working on an existing VFP system. I need to gather all the updated records from a large number of tables daily. The way I am using is to create a new field named UPDATE in a table. The default value is .F.. It is changed to .T. once the record is updated. This field will be reset to .F. daily after updated records are gathered. This way works okay. However, I need to change too many tables and programs.

Any helps would be appreciated.


Peter





 
i think thats the safest way to gather so you'll assure that you've gathered the record by the flag field you've made.
 
Hi Rottdpogs,
My problem is I have to change too many programs, forms and tables. Note that this is an existing VFP system with a large number of programs, forms and forms.

Peter



 
Your way is a good way, the only other thing you may want to look at is GETFLDSTATE(). It's a function that will give you a numeric value if a record has been edited. Here are the different values :

1 Field has not been edited or deletion status has not changed.
2 Field has been edited or deletion status has changed.
3 Field in an appended record has not been edited or deletion status has not changed for the appended record.
4 Field in an appended record has been edited or deletion status has changed for the appended record.
.NULL. At EOF( )
 
You might want to look into the FoxAudit product from TakeNote Technologies ( It would appear that it could provide you with what you want for just a few dollars compared to your possible "rewrite".

Rick
 
This will be a much slower way of doing it and it will consume so disk space, but it will not require a database/table structure change.

1. In a different subdirectory then your databases to check, Make a backup copy of the dbf's that you want to monitor.

2. In that directory make a new table with just 3 fields.
OrigDir, CopyDir, DBF

3. Write a program to use the new table that opens the dbf's to compair and do a record by record, field by field evaluation. If anything is different between the 2 tables, get the record and do what ever you do with it.

4. After the program is run. Copy the current dbf to the backup loaction for tomorrow's compair.

For a head start on the program to do the compair, Go look at this
David W. Grewe
Dave@internationalbid.com
 
you could just change the Update flag to be a DateTime Updated marker that, on every update is set to the current system DATETIME() value, and just use that in the queries to find records updated since Midnight this morning.

This still requires editing the program to set Updated to DateTime(), but it doesn't require changing anything when producing the list of updated records.
 
Hi,
Thanks a lot for your comments.

mgagnon, I have tried the funtion,GETFLDSTATE(), based on your suggestions. This function requires row or table buffering mode. The status of all the fields is always 1 if you reopen a table, even some records have been updated.

Rick, FoxAudit is a good product. I have sent an email to Jim Duffy to get some further information.

David, I have got your program and tried it. Your idea is very good. The process speed may be a problem. In my case the total size of the tables is over 500Mb. Is it possible to use local views, instead of tables in your program? It may speed up the process. I am going to give a try shortly.

wgcs, the problem is I still have to modify a large number of programs, forms and tables. It is big job I can see.

Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top