Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Manipulate datas at multiple directory
Message
From
12/10/2000 08:22:43
 
 
To
11/10/2000 22:13:51
Ransome So
Ransome's Workshop
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00428276
Message ID:
00428403
Views:
15
>For the method by program a function, How to do that? Can you show my an example?
PROCEDURE OpenTable
lparameters lcMyTable && parameter is a table
if !empty(gcDatabaseName) && if gcDatabaseName variable contains name of another database than default
  &&gcDatabaseName may contain, for example, "\data\CompanyA\MyDatabase.dbc"
  SET DATABASE TO (gcDatabaseName)
ELSE
  SET DATABASE TO ("\data\MyDatabase.DBC")
endif

&& open table
select 0
use (lcMyTable) again shared

ENDPROC
You may improve it to open table with special alias, buffering etc.
Note that you should define public variable gcDatabaseName in startup program. Than, when you switch to another database, just assign datbase name/path to that variable. In your forms use 'OpenTable("TableName")' in the Load event to open table.

>
>For the method 'SET DEFAULT TO', As the program files and the data files are put at the different directory. Will altering the Default directory cause program error for the exe file unlocated?

No. When you compile application into EXE file, commands like 'do MyProcedure.PRG' or 'DO FORM MyForm.scx' will automatically take program files from EXE file. You do not need to put program files with data, just EXE and data only.

HTH
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform