Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change Name of DBC
Message
From
12/04/2005 11:57:11
 
 
To
12/04/2005 09:30:12
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01003695
Message ID:
01003805
Views:
42
Hi Dirk.

>we have a dictionary with a DBC1 that has app 400 Tabels and the tabels
>in a subdictionary we have a coppy of all tabels and the DBC
>
>we want to rename the DBC in the subdictionary to DBC2, because later we need relationshisps between the turnover tabel in the subdictionay and the turnover tabel in the main dictionary. Becaus the name of the tabels is equal we need to change the name of the DBC

Here are the instructions from the Frequently Asked Questions topic in the SDT help file:

How can I rename a DBC?

It's a bit of work, but not difficult to do.

  • First, rename the DBC, DCX, and DCT files using the Windows Explorer.

  • Then, open the DBC exclusively in VFP and type VALIDATE DATABASE RECOVER in the Command window (you can't do this in a program in VFP 6 or earlier). You'll be notified that, for each table, the backlink in the table header is incorrect. Accept the option to replace the backlink with the correct one.

  • Next, open SDTMETA.DBF and type REPLACE DBCNAME WITH '[new DBC name]' FOR DBCNAME = '[old DBC name]', where [new DBC name] and [old DBC name] are the new and old DBC names, respectively, in lower case, without an extension or path. Find the record for the database (RECTYPE = "D" and OBJECTNAME is the former DBC name) and REPLACE OBJECTNAME WITH '[new DBC name]'.

    - Open COREMETA.DBF and type REPLACE CDBCNAME WITH '[new DBC name]' FOR CDBCNAME = '[old DBC name]'. Find the record for the database (CRECTYPE = "D" and COBJECTNAM is the former DBC name) and REPLACE COBJECTNAM WITH '[new DBC name]' and REPLACE MPATH WITH '[new DBC filename]'; in this case, [new DBC filename] includes a ".DBC" extension. Also, REPLACE CCAPTION WITH '[new DBC filename]', where [new DBC filename] is a PROPER(JUSTSTEM()) version of the DBC name.

    - Views may need to be redefined, since they may have "database!" in the Tables and SQL properties.

    - Finally, ship the new DBC and meta data tables to your client site and use SDTMgr's Update method to update their copy of the tables.


Doug
Previous
Reply
Map
View

Click here to load this message in the networking platform