Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem moving from mapped drives to UNC
Message
From
22/05/1998 08:18:47
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00100857
Message ID:
00101103
Views:
39
Snip...
>Cetin,
>
>I don't understand your reply. I think you are answering another question.
>In my application I have no paths hard-coded to open my tables or databases. I simply say:
>
>use database\atable.dbf
>use database\another.dbf
>use database\thisone.dbf
>
>Therefore the application only "knows" that it should reference the database tables in a subdirectory underneath the directory where the application is executing. This works find when I map a drive, but does not work when I use UNC (Universal Naming Convention).
>
>Example if I map a drive P: to FS_RENAL2\USER1\APPS
>I can then run the application p:\db\main\vmain.exe with no problems.
>
>If I dispense with the drive mapping and simply start the application by directory referencing FS_RENAL2\USER1\APPS\DB\vmain.exe it can not seem to find the "database" subdirectory.
>
>Any thoughts?
Evan,
I was indeed answering your question. Sorry for my English for that. More detailed here and hope understandable.
mpath = "\\server\dir\subdir..\app\data"
set path to (mpath)
open database myDBC && This is in \\server...\app\data
use myTable         && This is in \\server...\app\data
Works perfectly. I think you either don't set path at all (which is more likely based on error message) or mistakenly think app would use \\server\...\app\config.fpw for path. Unfortunately it doesn't use it by default when UNC is used and thinks your \\server...\app\database is a subdir of home() (which is most likely to be c:\windows\system). Well causes are hard to express for me so better tell solution. In all cases below path points to not only subdir (not -> path=database) but full UNC path (path=\\server\...\app\database).
Case 1 : Path is set at startup.prg
handle=fopen(home()+"uncpath.txt")
mpath=fgets(handle)
=fclose(handle)
set path to (mpath)
open database myDBC
...
In this approach you create a txtfile uncpath.txt in home() dir (most likely to be user's \windows\system dir). Or instead of uncpath.txt you could use an ini file as well.
Case 2 : Path is defined in config.fpw (as FULL UNC path). Then in your would be like :
Target : \\FS_RENAL2\USER1\APPS\DB\vmain.exe -CFS_RENAL2\USER1\APPS\DB\config.fpw
Startin : \\FS_RENAL2\USER1\APPS\DB\
and config.fpw path statement :
path=\\FS_RENAL2\USER1\APPS\DB\database && If spaces would be in path then quote
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform