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!

DBC pathing problem

Status
Not open for further replies.

perryf

MIS
Nov 15, 2001
63
US
We've encountered a little issue with paths stored in the DBC that I'm looking for some help on:

If the app is run on a local system, typically the app folder will be at least one folder deep from the root (c:\myappfolder). In the DBC stored in the app folder, the path to tables in the data folder will look like "..\data\mytable".

We have users running on Citrix. Their app folder is mapped as root. So m:\myappfolder is the top most folder. In this case the path in the DBC is "m:\data\mytable".

So we have an issue if we try to copy data from Citrix to a local drive because of the hard coded paths.

Does anyone know of a way around this, short of rebuilding the DBC when we copy the data, which is what we do now?
 
Is it the ".." that causes the problem? I don't know if Citrix is different but I've got systems running locally and under VPN where the path is defined as "data\mytable" for local users on \\direct\vfpcode\merged\data and remote users on h:\data.

Geoff Franklin
 
I'm sorry, the local path is defined as:

data\mytable

This is fine. No matter where we copy the system to, the data folder will always reside under the main folder and the path will always be correct.

As in your system the "h:\data" is what causes the problem. Obviously, if we copy the data there's a likelyhood that the new system will not have an "h:
 
Obviously, if we copy the data there's a likelyhood that the new system will not have an "h:"

I don't actually hardcode the "h:". Each user reads the path from a local ini file:

[TT]
;Any line starting with a semi-colon will be ignored
DATAPATH=\\Toshibapro\tosh_pro\Basket\TestData
;DATAPATH=Data
;DATAPATH=h:\Data
[/TT]

I also find this useful because it lets me switch between live and test data.

Geoff Franklin
 
Another approach is to always determine where you are beginning from on ANY system:

mcStartUp = SYS(5) + SYS(2003)

Then you can define your Data Directory with

mcDataDir = mcStartUp + "\Data"

Good Luck,
JRB-Bldr
 
unfortunately, neither solution of an ini file or startup variable helps.

The app will not start if the data has been copied from citrix to a local system. Because the paths are hardcoded such as "h:\data" in the dbc and the local system has no h:, we have to rebuild the dbc everytime we do the copy.
 
While it would take a bit of coding, you could always begin with No DBC and then, after installation, use the mcStartUp to determine the Home Directory and then use that to programatically (dynamically) create the DBC and its required Views using code.

That would ensure that things run wherever it is installed - H: drive or not.

I have done that for a few applications and, while somewhat tedious to develop, it worked well wherever it was installed regardless of drive mappings.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top