Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Manipulate datas at multiple directory
Message
 
 
À
11/10/2000 21:49:06
Ransome So
Ransome's Workshop
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00428276
Message ID:
00428282
Vues:
13
Hi!

You may do this by two ways.

First is more generic, require more programming, but it have a lot of advantages. Make your own function for data opening and do not use data environment. Open data using your function in the load method of form. You can still use data environment when designing new forms to quickly bind controls on form to tables. However, in final application use your function for data opening, so you may do in that function everything you want, include opening database on the path you need. So switching to another database will be just change of a variable that is used in you table opening function.

Second way is more simple, but you need to be very careful. Try to remove all full paths to tables from data enviroments. Than use 'SET DEFAULT' command to set current path to database. When you need to work with another database, you than just change path use 'SET DEFAULT' command. But you need constantly remember that table in data environment should be referenced by relative path.

>I am writing a account program, which in my design, I select various company client in a listbox, program switch to various directory and manipulate the datas.
>
>For the databases design,
>I put the program files at c:\account\file\
>I put the databases under a directory : c:\account\data\
>under the above directory,
>I put data for A company at c:\account\data\acompany\
>and for B company at c:\account\data\bcompany and so on.....
>
>However, at design time, the form designer set the data environment say c:\account\data\master\account.dbc
>How to program so that I can alter the data environment runtimely, and does it possible?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform