Page 1 of 1

Using UNC path to open files

Posted: Mon May 09, 2016 8:34 pm
by sstone
Hi,

I came across this code example in the Xbase 1.90.355 documentation of the USE command.

PROCEDURE Main
LOCAL oSession

oSession := DacSession():New("DBE=ADSDBE;SERVER=\\ALASKA01\VOL1")

USE "\\ALASKA01\VOL1\Customer" SHARED VIA (oSession)


RETURN

I have tried opening a table on an Advantage server using the same approach. I am setting up a web server and I am trying to avoid using a drive letter (which works) on the advice of the network security technicians since according to them it creates a vulnerability. I would like to be able to use the form USE \\servername\path\tablename but I am getting the error message Error Base\0 Dbusearea.

I have also tried SET DEFAULT TO \\servername\path but this does not work.

Does anyone have any experience with using a UNC path in this way?

S Lorde

Re: Using UNC path to open files

Posted: Tue May 10, 2016 12:34 am
by Tom
UNC-pathes work well, even with SET PATH or Set(_SET_PATH). Try this:

Code: Select all

USE ("\\ALASKA01\VOL1\Customer") SHARED VIA (oSession)
or this

Code: Select all

cFile := "\\ALASKA01\VOL1\Customer"
USE (cFile) SHARED VIA oSession

Re: Using UNC path to open files

Posted: Tue May 10, 2016 7:33 am
by Cliff Wiernik
You may also need to explicitly specify the port, default of 6262.

\\servername:6262\volumename.

We have do do that for instances of connections between our local office, central wisconsin and our Chicago IL web servers.

Re: Using UNC path to open files

Posted: Tue May 10, 2016 7:45 pm
by sstone
I made the code changes as suggested. The file opened only when the port was specified. Additionally, apparently because of how the network is setup, I had to use the server IP address instead of the name of the server in the path. At least it worked. Thanks a lot guys.

S Lorde

Re: Using UNC path to open files

Posted: Wed May 11, 2016 12:57 am
by Tom
Create an ADS.INI if possible to a) improve performance while detecting the server and b) avoid adress conflicts.

Re: Using UNC path to open files

Posted: Wed May 11, 2016 5:27 am
by sstone
The configuration of my standard program version uses the Ads.ini file in which the server IP is specified. I will experiment with other settings for this file in the web version to see what is possible given the network architecture that I have been given. Thanks, Tom.

S Lorde