Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I put the DBC in another directory?

Status
Not open for further replies.

jrumbaug

Programmer
Apr 27, 2003
90
US
I'm working on distributing my first application with a Data Base Container. In one installation, all the directory and subdirectiries were the same as the development, but it was on a D: drive not a C: drive. I got errors that the tables could not find the DBC. Copied it all to the C: and it worked. Are there suggestted rules for where to install the DBC and how to make sure the tables can find it if it is different than the development arrangement? For example, during development the DBC is in C:\MyApp, but it is installed in D:\CompanyName\MyApp.
 
jrumbaug,

the best advice I can give you is: keep the .DBC in the same folder of your tables. It's NOT mandatory, but you can avoid many headaches later on.

To answer your second question: use the PATH statement in your CONFIG.FPW to have VFP find the data (i.e.: PATH=DATA, where DATA is the folder [containing your tables and your .DBC] underneath the folder where your EXE lives).

TheSofty
 

jrumbaug,,
In addition to TheSofty :
In my start.prg I do have next code which works fine for me

Code:
If version(2)=0 && runtime
  gcDefaultDir=sys(5)+sys(2003)
Else					
  gcDefaultDir= _vfp.ActiveProject.HomeDir
endif

gcDefaultPath="..\code,data,forms,graphics,help,libs,include,menus,reports,sound,sdt"

set default to (gcDefaultDir)
set path to    (gcDefaultPath)
 
If its any help to the other suggestions here, our app uses 5 separate DBC's and in some installs the DBC's are on different servers on a network. We use a control file with the network paths stored (created during installation) and in our main file we retrieve the path to a local var e.g.
Code:
lcPath = "Populate, "+"Reports, " + ALLTRIM(control.pathA)+ ", " + ALLTRIM(control.pathB) + ;
			", " + ALLTRIM(control.pathC) + ", " + ALLTRIM(control.pathD) + ", " + ALLTRIM(control.pathE)
*** Then issue
SET PATH TO &lcPath
The populate and reports folders exist in the launch dir which VFP searches anyway.



Bob Palmer
The most common solution is H2O!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top