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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Network File Location problem

Status
Not open for further replies.

CDavis

Programmer
May 5, 2000
155
US
I am having a problem with an executable that I'm trying to place on a local area network. I've placed all the program and data files at the following location: \\appserver1\workorders\depreq\ I've placed a shortcut to the executable on my desktop and set the start in location to the same directory -- I get the following error message:

File '\:\\appserver1\workorders\depreq\bldg.dbf' does not exist.

I've tested the program on local drives and also network drives that are mapped -- all with no problems.

Any suggestions will be appreciated. [sig][/sig]
 
Here is your problem (in red):

'\:\\appserver1\workorders\depreq\bldg.dbf'

Remove that and you should be fine. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Hi CDavis,

FWIW, I set up a test domain under the same conditions you described and could not replicate the behavior you are describing, unless the dbf didnt exist.

File '\:\\appserver1\workorders\depreq\bldg.dbf' does not exist.

Typo?? If not, then this is probably relevant.

Are you opening your tables with absolute paths?
Example:
MyDataPath=AddBS(JustPath(Application.ServerName))
USE MyDataPath+'MyTable'

Post the code that generates this error message and any other code you feel might be relevant. [sig]<p>Jon Hawkins<br><a href=mailto: jonscott8@yahoo.com> jonscott8@yahoo.com</a><br><a href= > </a><br>Focus on the solution....Not the problem.[/sig]
 
Thanks for the replies:
I'm not sure where to remove the \: because I'm not sending it. As Jon suggested I've included the relevant code which is basically a Use in 0 statement. All DBF's are in the same folder but only the config.dbf is found by foxpro. Ultimately my goal is to have the executable reside on the local machine with the config.dbf and that's why I'm telling the program to go to the foxpro startup directory to find it. The other data files which will have a lot of activity I want to reside on the network so they get backed up daily.

Additional information: This program is written in VFP 3.0 on an NT system.

In the properties.shortcut of the desktop icon I have the following:

Target: \\Appserver1\WorkOrders\Depreq\cdpro.exe

Start In: \\Appserver1\WorkOrders\Depreq

It works fine when I have it on the network on a mapped drive as in

Start In: H:\workorders\depreq.

The following code is in the Setup for the menu:

ON SHUTDOWN DO MY_SHUTDOWN
ON ERROR DO ERRORHANDLER WITH ERROR(), MESSAGE(), LINENO(), SYS(16)

MODIFY WINDOW SCREEN ICON FILE CDPRO.ICO
MODIFY WINDOW SCREEN TITLE &quot;Cd\Pro&quot;

mTRIM = RAT(&quot;\&quot;,SYS(16))
mPATH = SUBSTR(SYS(16),1,mTRIM)

SET CENTURY ON
SET EXCLUSIVE OFF
USE bldg IN 0
USE (mPATH) + &quot;CONFIG&quot; IN 0
USE DEPREQ IN 0

Further suggestions will be appreciated.

Thanks,
CDavis [sig][/sig]
 
All DBF's are in the same folder but only the config.dbf is found

Alarm bells activated when I read that, because if it was my program, 10:1 odds are that I'm reading that config.dbf and setting a default or path based on some data contained there for all the other files, and that is where something may be amiss.

I don't know that you are doing anything like this with your config.dbf, but I thought it odd that it would only find that one file. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Robert,

It may be that name of the config.dbf is confusing because it only contains data to identify the user, things like the building the pc is located in, their department no. and telephone number -- it doesnt contain any file location data. As you'll notice in the code, I'm using SYS(16) to give me the program name and path and then I'm stripping off the program name to find the path. The config.dbf by design will always be located in the same file folder as the program on a local drive -- however ultimately the data files will be in a separate location. I'd like to avoid hard coding the location and use windows to set the start in location -- I'm not sure why the location is not being read correctly -- any further comments will be appreciated.

Thanks -- CDavis [sig][/sig]
 
Just for giggles, you might try HOME() instead of SYS(16) to see if you get any difference. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
It appears that windows may not be passing the working directory correctly. I've tested several different scenarios and in every case when I use a mapped drive foxpro reads the working directory correctly but when I use \\appserver1\... foxpro thinks that the default drive is C: and the working directory as being ...\desktop

Interesting, I guess I'll either add a field to the config.dbf file pointing to the correct location or I'll hard code the path.

Let me know if any of you have any other thoughts.

Thanks -- CDavis [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top