Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to control which DBC is Open…
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00878319
Message ID:
00878348
Views:
15
Hi Doug,

After many test this is the result:
If I have two MyData.dbf open in memory and I do this
set database to c:\MyData2\MyData.dbf
Use MyData!Mytable
It c:\MyData1\MyTable.dbf that is open.

If I do this:
Use c:\MyData2\MyData!Mytable
It c:\MyData2\MyTable.dbf that is open.

The problem I have is that in Local View VFP wrote MyData!MyTable.
So it a VFP Gotcha!
The solution is in the order of opening the tables.


>Hi Jean-René.
>
>>But if you have two DBC one in c:\MyData1 and one in c:\MyData2 which one is Open if you do this.
>>
>>Use C:\MyData1\MyTable  in 0
>>Use C:\MyData2\MyTable in 0
>>
>
>Both DBCs are open in that case. Neither one is selected (ie. DBC() returns an empty string).
>
>>After this code you do this:
>>
Use MyDBC!MyTable2 in 0
>>
>>From which directory MyTable2.dbf is open?
>
>I looked into this several years ago, so my memory may be fuzzy, but I believe the DBC opened last is the one that's used in this case.
>
>>Is there a way to control which DBC is Open?
>
>You can control which one is selected by doing SET DATABASE TO (full path of the DBC). Then you can just USE MYTABLE rather than USE MYDBC!MYTABLE.
>
>>Can I Open a table, which is part of the DBC, without opening the DBC?
>
>No.
>
>Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform