Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening a table from a DBC with different pathing
Message
From
08/10/2007 17:43:18
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01259546
Message ID:
01259596
Views:
16
>>I think there would be two ways to open the tables under these circumstances:
>>
>>1. Open the database first.
>>
>>
>>open database (lcDatabaseDir + MyDatabase)
>>use MyTable1 && This should require no path.
>>
>>
>>2. Open the table directly.
>>
>>
>>use (lcTableDir + MyTable1)
>>
>>
>>HTH,
>>
>>Hilmar.
>
>Thanks for the reply, Hilmar, however I'm glad I can say it wasn't THAT bad of a day! I mean I am familiar with the USE command. <g>
>
>The point of my posting was that when I try to open the table with no DBC open and I just USE the table using the path and file name, I get a dialog box saying it can't locate the DBC. When I open the DBC directly, then try to USE the table, giving it no file and path name, it tells me it can't find the file. When I USE it using the full path and file name, it tells me it can't find the file. (Yes, the file exists.) This is due to the forward link in the DBC to the DBF and the back link in the DBF to the DBC. The DBC wants to find the table in a certain place regardless of what I tell it and the DBF wants to find the DBC in a certain place even though the DBC is already open. But now the DBC and the DBFs exist in places different from where they reside on the server, so VFP is stumped.
>
>I may have to resort to low level file functions to adjust the forward and back links before opening the tables.

If you get this error message, then it seems that the database lost track of its tables (or the tables of the database). It would seem that after moving about the directories, you would need a VALIDATE DATABASE or something of the sort.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform