Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Automate the Validate Recover method
Message
From
16/01/2006 15:37:32
 
 
To
16/01/2006 10:47:29
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01087177
Message ID:
01087305
Views:
13
>I have an application that I wish to allow users to create a duplicate of the databases and tables. For example a multi office application where the underlying information is completely different but the dbc/tables/application are exactly the same. I have coded to allow the users to select between datasets by creating separate subdirectories and datasets beneath the application main directory. Now I want to programatically copy the database & related tables to a subdirectory if a user wants to add a new office to their application.
>
>In order to maintain system integrity I want to have a unique name for each new database so I copy the database and related tables then rename it. I can easily validate the new database with "recover" through the command prompt then manually reply 'yes' to resolve the back link messages but I would like to automate this process so it is invisible to the users.
>
>Does anyone know of a way that I can accomplish this? I have tried using the ON ERROR to return a "YES" (6) then calling Validate Recover, but the validate routine seems to ignore this. I assume it's not actually generating an error but a message.

Another general approach might be to use the GenDBC program. When you run this against your original database it creates a program (e.g. "BuildMyDBC.prg") that, when itself run, can re-create your database. It might be possible to modify BuildMyDBC.prg to reflect the new name required.

As an alternative it's probably possible to use low-level file functions and programmatically modify file headers in tables to point to a differently-named .DBC. I don't know how to do that but you might find the answer by searching through threads here.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform