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!

Creating an object that acts like a copy of my DBF

Status
Not open for further replies.

fblair301

Technical User
May 28, 2006
4
US
I want to create an object that will look just like my base DBF. I will add data to that object from changes on a form. When I have audited the changes then I want to be able to just Insert that data into the base DBF as a new record.

How do I create the object copy?

Thanks,
Fred
 

It looks like you need to use table buffering/TABLEUPDATE()/TABLEREVERT().
 
Hi Fred,

I think SCATTER NAME and GATHER NAME will work for you.

Jim
 
Fred,
Both Jim and Stella's suggestions will work. Implementing the TableUpdate() TableRevert() may seem a little trickier in concept if you've not used it before, and is the safer option. If you use SCATTER NAME <name> GATHER NAME <name> the fields can all be referenced as <name>.<FieldName>, just like the old M.<FieldName>, which may feel a bit more comfortable to you if you're from the Fox "Old School", but you will be responsible for getting and "keeping" your record pointer movements, which leaves you with the risk of over writing a record.
I would suggest taking an hour or two, and understanding TableUpdate (using either Optimistic or Pesimistic Table Buffering... forget Row Buffering), and build your app that way. In the long run, is much easier to do too, withouth mucking with variable names for fields ever again...

Just for info, Optimistic buffering does not try to "lock" the record until you try to write it, allowing others to view the record, and make changes. Pesimistic buffering locks the record as soon as the user makes an edit request, and keeps it locked until the write is done. Depending on your needs, you would need to determine which is right for you.



Best Regards,
Scott

&quot;Everything should be made as simple as possible, and no simpler.&quot;[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top