Acces of a file with IP Adress

Acces of a file with IP Adress

Postby Jack » Thu Apr 17, 2008 8: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 .
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am

Re: Acces of a file with IP Adress

Postby Enrico Maria Giordano » Thu Apr 17, 2008 9:17 am

Try using WNetAddCon() function.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Jack » Thu Apr 17, 2008 9: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 .
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am

Postby Enrico Maria Giordano » Thu Apr 17, 2008 10:12 am

Sorry, I don't know.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Rick Lipkin » 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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Jack » 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
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am

Postby Rick Lipkin » 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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Jack » Thu Apr 17, 2008 3:04 pm

Rick,
Thanks for your help,
it works fine .
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am

Re: Acces of a file with IP Adress

Postby Otto » Sun Sep 06, 2009 9: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: Acces of a file with IP Adress

Postby Rick Lipkin » 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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Acces of a file with IP Adress

Postby Sheng » Mon Sep 07, 2009 1: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
Sheng
 
Posts: 15
Joined: Mon Sep 29, 2008 1:41 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: cmsoft and 67 guests