Using UNC path to open files

This forum is for general support of Xbase++
Post Reply
Message
Author
sstone
Posts: 17
Joined: Tue May 25, 2010 7:57 pm

Using UNC path to open files

#1 Post 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

User avatar
Tom
Posts: 1170
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Using UNC path to open files

#2 Post 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
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Using UNC path to open files

#3 Post 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.

sstone
Posts: 17
Joined: Tue May 25, 2010 7:57 pm

Re: Using UNC path to open files

#4 Post 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

User avatar
Tom
Posts: 1170
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Using UNC path to open files

#5 Post by Tom »

Create an ADS.INI if possible to a) improve performance while detecting the server and b) avoid adress conflicts.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

sstone
Posts: 17
Joined: Tue May 25, 2010 7:57 pm

Re: Using UNC path to open files

#6 Post 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

Post Reply