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!
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement