Page 1 of 1

Acces of a file with IP Adress

Posted: Thu Apr 17, 2008 8:40 am
by Jack
It is possible to do this :
select 0
use \\192.168.10.3\DATA\XYZ.DBF

How to establish the connection to the server (user name and password) if there is not network letter already mapped ??
Thanks .

Re: Acces of a file with IP Adress

Posted: Thu Apr 17, 2008 9:17 am
by Enrico Maria Giordano
Try using WNetAddCon() function.

EMG

Posted: Thu Apr 17, 2008 9:48 am
by Jack
Thanks for this answer .
I dont want to use a drive letter because i dont want the user to be able
to explore the network drive .

Posted: Thu Apr 17, 2008 10:12 am
by Enrico Maria Giordano
Sorry, I don't know.

EMG

Posted: Thu Apr 17, 2008 10:37 am
by Rick Lipkin
Jack

UNC paths work just fine .. however i would be careful in a WAN environment .. just too many things can happen over long distances .. users still need share rights to your databases ..

I use \\server\volume\folder\table.dbf ... all the time and you can set defa to a unc as well and then just select as usual.

Rick Lipkin

Posted: Thu Apr 17, 2008 11:00 am
by Jack
Rick,
Thanks for your help .
How to have access to the server (how to log) before the use of the Unc.
I dont want that the user have access to the network drive with explorer .

Thanks

Posted: Thu Apr 17, 2008 12:55 pm
by Rick Lipkin
Jack

I agree with you .. I have used UNC access for just that reason .. I don't want people running thru a mapped drive with Explorer to get to my application just to open the tables in Excel and really mess things up.

You can use either a DNS name like :

use (\\myserver\volume\folder\table.dbf)

or

use ( \\10.1.10.111\volume\folder\table.dbf )

Again .. users will need full rights to the application folder, but it does not need to be mapped.

Rick Lipkin

Posted: Thu Apr 17, 2008 3:04 pm
by Jack
Rick,
Thanks for your help,
it works fine .

Re: Acces of a file with IP Adress

Posted: Sun Sep 06, 2009 9:04 pm
by Otto
Hello Rick,
use (\\myserver\volume\folder\table.dbf)
or
use ( \\10.1.10.111\volume\folder\table.dbf )
Could you show how to pass user and password?

Thanks in advance
Otto

Re: Acces of a file with IP Adress

Posted: Sun Sep 06, 2009 10:29 pm
by Rick Lipkin
Otto

Your user will need prior authendication rights given to them from their Network Admin .. once they have folder permisions the UNC will work fine .. no userid or password is necessary.

This will even work and span servers as long as the proper user permissions are set

\\server1\volume\folder\table.dbf
\\server2\volume\folder\table.dbf

As long as the user has permissions to the above folder on either server ..

select 0
use( "\\server1\volume\folder\table.dbf") via DBFCDX shared

or

select 0
use( "\\server2\volume\folder\table.dbf") via DBFCDX shared

will work.

If you know the server1 or server2 IP address .. you can substitute the address for the server name

Server1 IP is 10.1.34.40
Server2 IP is 10.1.34.41

select 0
use( "\\10.1.34.40\volume\folder\table.dbf") via DBFCDX shared

or

select 0
use( "\\10.1.34.41\volume\folder\table.dbf") via DBFCDX shared

Everything I have said here assumes the above server(s) are within the same organization and firewall .. anything outside of that you will need a different strategy.

Hope that helps ..

Rick Lipkin

Re: Acces of a file with IP Adress

Posted: Mon Sep 07, 2009 1:38 am
by Sheng
new Harbour 2.0beta3 support it!!
NETIO_CONNECT( "192.168.0.1" )
use net:table1
NETIO_CONNECT( "192.168.0.2" )
use net:table2
use net:192.168.0.3:table3