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!

tableupdate and tablerevert(help)

Status
Not open for further replies.

channelmaster

Technical User
Dec 9, 2001
52
PH
HI! Can someone help me with my problem? How can I tableupdate() and tablerevert() multiple related tables?

ex:

table1 has a field "customer_id" and table2 has a fields "customer_id" and "record_id" and table2.customer_id is related with table1.customer_id, table3 has field "record_id" and is related to table2.record_id. my problem is on how to tableupdate() the three tables when I issue tableupdate() on table1, and likewise on tablerevert(). Tableupdating has no problem, but when i issue tablerevert() table2 and table3 does not tablerevert(). I hope my problem is clear to you. Thanks in advance.
 
Well, you can explore the possibility of using triggers on table1, but do you really want that? I may be misunderstanding you, but it sounds like you want automatic updates of other related tables. If that's accurate, check out triggers in VFP help.

Also, when updating your tables, consider wrapping them with BEGIN TRANSACTION / END TRANSACTION (or ROLLBACK). VFP Help explains why this helps you with better design, lessening the chance of corruption and making sure that it's an "all or none" change.

HTH,
--Michael
Michael J. Babcock, MCP
Founder, Central PA Visual Foxpro Users Group
mbabcock@cpvfug.org
 
Dear Michael,
That's the point. I want to auto-update whenever the Table1 is issued tableupdate() or tablerevert(). I am confused about the triggers and the command rollback, can you make a sample of these. I hope for your kind consideration. Thanks
 
channelmaster

There is a sample of TRANSACTION code in thread184-447708. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Are you sure that when you make tableupdate and tablerevert that table is selected?

Some times ago I've got the some problem. I had wont to tablerevert one table, but I was in other selected area. It takes 2 days to find out this mistake.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top