FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Acces of a file with IP Adress
Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Acces of a file with IP Adress
Posted: Thu Apr 17, 2008 08:40 AM

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 .

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Acces of a file with IP Adress
Posted: Thu Apr 17, 2008 09:17 AM

Try using WNetAddCon() function.

EMG

Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Acces of a file with IP Adress
Posted: Thu Apr 17, 2008 09:48 AM

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 .

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Acces of a file with IP Adress
Posted: Thu Apr 17, 2008 10:12 AM

Sorry, I don't know.

EMG

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Acces of a file with IP Adress
Posted: Thu Apr 17, 2008 10:37 AM

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

Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Acces of a file with IP Adress
Posted: Thu Apr 17, 2008 11:00 AM

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

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Acces of a file with IP Adress
Posted: Thu Apr 17, 2008 12:55 PM

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

Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Acces of a file with IP Adress
Posted: Thu Apr 17, 2008 03:04 PM

Rick,
Thanks for your help,
it works fine .

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Acces of a file with IP Adress
Posted: Sun Sep 06, 2009 09:04 PM
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
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Acces of a file with IP Adress
Posted: Sun Sep 06, 2009 10:29 PM

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

Posts: 15
Joined: Mon Sep 29, 2008 01:41 PM
Re: Acces of a file with IP Adress
Posted: Mon Sep 07, 2009 01:38 AM

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

Continue the discussion