Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using 2 DBCs with the same name
Message
From
27/11/2001 15:10:59
 
 
To
27/11/2001 12:08:42
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00586186
Message ID:
00586573
Views:
24
I first developed the app with a drive mapping but I had to switch to UNC paths when it became live.
At this site we have to keep our data seperate from our apps.

SInce then no copies of the Data folder will work with out doing a
VALIDATE DATABSE RECOVER
and this will only work if I first rename the live data folder briefly so that the copy DBC does not just find the live tables on the network:(


>Mark have you ryied to first map a drive and then copy the dbc and dbf's.
>
>>For some reason this has never worked for me.
>>My DBC has entries that look like the following in the property field.
>>
>>
>>\\condor\ijc\ijctnd\data\unit.dbf
>>
>>
>>If I try to amend them then the table becomes corrupt no matter how careful I am.
>>
>>Sometimes I can remove the unc reference for a single table but if I try to do them all it becomes corrupt:(
>>
>>I even wrote the follwing utility to remove the refernces but it does not work, I suspect because the tables themselves have backlinks to the DBC.
>>
>>
>>
>>
>>close databases
>>use getfile('dbc')
>>
>>scan for objecttype='Table'
>>   lcProp=lower(property)
>>   lcLeft=left(lcProp,at('.dbf',lcProp)+3)
>>   lcFile=subs(lcLeft,rat(CHR(1),lcleft)+1)
>>
>>   repl property with strtran(property,lcFile,justfname(lcFile))
>>
>>endscan
>>
>>
>>
>>
>>
>>
>>>Mark this is not a problem since the dbc only keeps the logical path to the table e.g. database is on the root folder the tables are on dbf folder under root the databse will keep a referent to dbf\tablename.dbf, being this you can copy the database plus the tables as log as you keep the same structure.
>>>
>>>being this the case your problem is resolved.
>>>
>>>>I am using UNC paths to connect to my data sources and copying the entire folder just means I have a DBC which is still pointing back to my live files.
>>>>
>>>>
>>>>
>>>>
>>>>>Also Mark if you whant to get everything from live to test then why not copy the all files DBC, DCT, DCX, DBF, CDX, FPT.
>>>>>
>>>>>>Thanks Alexandra
>>>>>>
>>>>>>My problem is that my databases have the same name.
>>>>>>
>>>>>>This is the brick wall I keep walking into:(
>>>>>>
>>>>>>
>>>>>>>Hi Mark you can do the following:
>>>>>>>
>>>>>>>OPEN DATABASE livedatabase
>>>>>>>OPEN DATABASE testdatabase
>>>>>>>use testdatabase!mytable IN 0 ALIAS testtable
>>>>>>>SELECT testtable
>>>>>>>COPY TO mytable DATABASE livedatabase WITH CDX
>>>>>>>CLOSE DATA ALL
>>>>>>>
>>>>>>>>I often have to work with 2 DBCs with the same name.
>>>>>>>>For example my test database and my live database.
>>>>>>>>
>>>>>>>>If I want to zap the tables in my test DBC and append into them from the live DBC I have to use the full path to the live table.
>>>>>>>>
>>>>>>>>Is there someway to set an alias to DBC different from its name?
Previous
Reply
Map
View

Click here to load this message in the networking platform