Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't add foreign key programmatically?
Message
From
05/02/2003 16:22:49
 
 
To
05/02/2003 15:35:35
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00749448
Message ID:
00749569
Views:
32
David,

Needing more than one statement to update your table structures would probably be the norm anyway. You might as well use INDEX ON. For VFP7, you can use execscript() to execute the code from the memo field. Wayne M's VFP tips in UT Magazine (most current issue, I think), there is code snippet for VFP6.

Also, consider something like Stonefield Data Tools, or xCase. I'm fairly certain that both of these programs will generate scripts that can be used to apply data layout changes on the client side.

Another possibility, which will work if you don't change the names of fields. You can distribute a new, empty table and .CDX file with the new structure. USE the new table, APPEND from the old table, copy the new over the old (archiving old table if necessary).

HTH,

steve


>Thanks. The reason I am trying to use alter table is that I am building a program that will allow us to make all of our table changes for this application programmatically, and, provide an audit trail on the date and time the change was made. So I am putting alter table statements into a memo field of a table. We have a situation where there are multiple copies of the same database (actually, in this case, sets of free tables in a folder), with one set of tables/database per client that the application runs for. So we need a routine that allows us to first update structures to a 'master database/tables set), and then we need to propagate all those changes to the remaining clients tables.
>
< snip >
>
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform