Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I can't connect to my data
Message
From
28/02/2000 09:26:51
 
 
To
28/02/2000 06:49:01
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00338312
Message ID:
00338378
Views:
17
Hej igen Ben,

Det kan gøres med:

\\ip-address\tables /user:domainname\Username Password

ex.
\\oracle8i /user:tim\tim tim

Det ved jeg ikke hvis det virker for dig.
\\ip-address\tables\mydbf.dbf /user:domainname\Username Password

Men du ku' også prøve API call'en

WNetAddConnection

Ex.

*****************************************************
* Function that returns .T. or .F. on whether or not a driveletter is available

FUNCTION IsDriveAvailable
LPARAMETERS cDriveLetter

LOCAL lRetVal, nDType

nDType = DRIVETYPE(cDriveLetter) && Determine drive type

IF nDType = 1 && No root directory
lRetVal = .T.
ELSE
lRetVal = .F.
ENDIF

RETURN lRetVal

******************************************************
*
* Function to map a network-path to a drive-letter on the local machine
*
* The function returns the following :
*
* -1 : The local device was already in use
* 0 : The function was successful
* >0 : Other errors


FUNCTION MapDrive
LPARAMETERS cLocalDriveLetter, cNetworkPath

LOCAL nRetVal

DECLARE INTEGER WNetAddConnection IN win32api;
STRING, STRING, STRING

nRetVal = WNetAddConnection(cNetworkPath, null, cLocalDriveLetter+':')

RETURN nRetVal

********************************************************************

* Function to un-map a drive
* Return 0 on OK, -1 on error

FUNCTION UnMapDrive
LPARAMETERS cDriveLetter

LOCAL nRetVal, cNetPath, nSucces

nRetVal = -1

DECLARE INTEGER WNetCancelConnection IN win32api ;
STRING, INTEGER

cNetPath = GetNetWorkPath(cDriveLetter)

IF NOT EMPTY(cNetPath)
nSucces = WNetCancelConnection(cDriveLetter + ':', 1)
IF nSucces = 0
nRetVal = 0
ENDIF
ENDIF

RETURN nRetVal



DWORD WNetAddConnection(
LPTSTR lpRemoteName, // pointer to network device name
LPTSTR lpPassword, // pointer to password
LPTSTR lpLocalName // pointer to local device name
);

HTH!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform