Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open table IP adresse
Message
From
05/10/2018 15:40:39
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
 
 
To
05/10/2018 10:20:46
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2016
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01662477
Message ID:
01662482
Views:
54
>Is it possible to open a table with the IP adresse or it must be with the UNC name ?
>
>Ex. : USE \\10.0.1.10\DB\Client

Yes, you can do that. The rules are basically the same as for UNCs, the format needs to be:

\\Server\ShareName\OptionalPathWithinShare\FileName.Ext

Basically, you can use an IPv4 address instead of the Server name, so

\\Server\ShareName\OptionalPathWithinShare\FileName.Ext
\\IPv4Address\ShareName\OptionalPathWithinShare\FileName.Ext

are equivalent. The main differences:

- The IPv4 form only works reliably for static IP addresses. If the server's IPv4 address changes (i.e. it gets its IPv4 address via DHCP) then you'd need to use the updated address if it changes for any reason.
- The IPv4 form does not require a DNS lookup, so if you suspect issues with DNS, it will bypass it
- Although the server name form requires DNS lookup, it can work in a DHCP environment with non-static addresses

So, in your original example, if "DB" is a defined share on server \\10.0.1.10, and "Client.dbf" is a table in the root of the "DB" share, then that should work.

Note that the \ShareName portion is not optional. In most environments sysadmins will set up shares for shared files. You can get a list of available shares on a server computer by running NET SHARE in a CMD window on the server computer.

If for some reason there isn't a defined share that contains the file(s) you want to use, you can make use of the built-in "administrative" shares instead. Every logical drive on a server has an admin share, which is the local drive letter followed by "$" e.g.

The administrative share for a server's local C: drive is C$
The administrative share for a server's local E: drive is E$

To make use of these administrative shares usually requires admin level access on the server. There may also be special restrictions on C$ (or at least its root) on Windows Vista or later.

So, if files you want to use are on a server drive E:\DB\, and there currently is no predefined share for that folder, you could

USE \\10.0.1.10\E$\DB\Client.dbf

However, you need to be connected with sufficient privileges to be able to do that from within VFP. It would probably be simpler to manually map a drive letter in advance in a CMD window:

NET USE Z: \\10.0.1.10\E$

This will ask you for an appropriate user name and password if you don't already have enough privileges. Then you can just run

USE Z:\DB\Client.dbf

to open your file.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform