Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Basic questions on VFP table searching.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00157610
Message ID:
00157660
Vues:
18
>My application is an .exe file with a MAIN program and menu. Some basic questions:
>
>When VFP 5.0 looks for a table to open, and there are multiple tables having the same name in the Foxpro path, is it true that a table in the default directory has priority over another table with the same name that is elsewhere in the foxpro path?

Yes, the default directory takes precedence. Of course, if you have a database open, then the database takes precedence. If you have multiple databases open, then the current database (see SET DATABSSE TO) takes precedence.

>
>Is it true that every form and report with a private data session opens the database container when it fires up? Or is it possible to open the dbc once in program MAIN and let that dbc dictate what tables are available to subsequent forms/reports? I want tables in the default directory to be ignored sometimes. If each form, report, and label program initiates Foxpro table searches upon startup, what is the best way to specify something other than the default search heirarchy?

If you have tables in your form or report's dataenvironment, then the database associated with those tables is automatically opened. If you do not want this behaviour, then your only option is to not include tables in your dataenvironment. If you need to open a specific database, you can open it in your main program. The best way to do this is to point to the specific database you want. i.e. instead of OPEN DATA mydata, you would use OPEN DATA data\mydata OR OPEN DATA \\myserver\mydirectory\mydatadir\mydata, etc. If you are using private data sessions, you will also need to manually open it in the form's load event (or perhaps opentables event of the dataenvironment - this will work with reports). You might want to use a global variable to store the path you wnt to use. i.e. in your main program set gcDataPath to "\\Serv1\DataApp\Data\Mydata". In your forms, issue OPEN DATA &gcDataPath. Once you have the specific database that you want opened, you can manually open all the tables you need. i.e. USE table1 IN 0, USE table2 IN 0, etc...
>
>In the project designer, when I highlight the name of my database, the dbc's location appears at the bottom of the designer (in un-docked mode only!?!). Does this location have anything to do with where Foxpro searches when a form fires up from the compiled (exe) program?

No, not really. You can include any database you want in the project manager. All this allows you to do is manipulate the data from the project manager. When you run your .exe you will have to point to the specific database you want or allow vfp to search the defaut dir and then your path dirs for the database.
>
>Thanks!

HTH

-Brien
Brien R. Givens

Brampwood Systems
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform