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

How to verify uniformity across databases/tables VFP9 SP2.

Status
Not open for further replies.

foxlover2012

Programmer
Sep 2, 2012
29
US
Hi all,
After a system is deployed, changes are made to tables structures and databases on the development side. What is the best way to update the structures on the client machines? Right now I'm just keeping track of changes and run a script to update the tables. Is there an automated way to compare 2 tables and make changes automatically? How do you all handle this?
Thanks, John
 
Hi John,

It should be fairly easy to write a PRG that compares two databases. You could use ADBOBJECTS() to get the names of the tables (and other objects) in the database. Then use AFIELDS() to get the structures of each of the tables.

But I wonder if you really need to do that. What I do is as follows: When I need to make a change to the structure of a table, I write a program using ALTER TABLE (or CREATE TABLE, DROP TABLE, INDEX, etc), and run it on my development system. When I'm ready to deploy the update, I arrange for the customer to run the same program on the production system.

This seems the simplest option, and has always worked for me.

If you want a totally automatic way of doing it, you should look at Stonefield Database Toolkit. But that might be over-kill.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
What I do is put a database version number in one of the tables, then when the
executable runs it comares its version number with the version of the database.

If the executable is newer, then it runs an update procedure that adds or alters fields
(very rarely dropping them) - the last phase of which is to update the version number.

That way, users can update to the newest version of a system from any older version, all
the mods to the database structure are included in the executable and are applied sequentially.

If I have mods that do not require a structural update, I only change a letter suffix to the
version number. So a change from 1.20A to 1.20B doesn't do a structure update, but 1.20B to
1.21 does.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top