PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Error codes
  • Use in Windows Vista (and later)
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Associates a drive with a shared network directory.
Example
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)Ajax
// Associe la lettre "E:" au répertoire réseau \\DocumentsPartagés\Fichiers
ResConnexion is int = NetworkConnect("E:", "\\DocumentsPartagés\Fichiers")
 
SWITCH ResConnexion
CASE 1
Error("La connexion n'est pas supportée.")
CASE 2
Error("Il n'y a pas assez de mémoire disponible.")
CASE 3
Error("Mauvais pointeur.")
CASE 4
Error("Mauvais type de device.")
CASE 5
Error("Mauvais profil utilisateur.")
CASE 7
Error("Il y a déjà une entrée pour ce device dans le profil utilisateur (Déjà connecté)")
CASE 8
Error("Mauvais réseau ou mauvais chemin.")
CASE 9
Error("Pas de réseau.")
CASE 10
Error("Erreur réseau..")
CASE 11
Error("Mauvais nom de réseau.")
CASE 12
Error("La lettre du lecteur est invalide.")
CASE 13
Error("Mauvais mot de passe.")
CASE 14
Error("Accès refusé.")
OTHER CASE
Info("Lecteur créé avec succès")
END
Syntax
<Result> = NetworkConnect(<Drive Letter> , <Network Directory> [, <Options>] [, <User> [, <Password>]])
<Result>: Integer
  • 0 if the connection was established
  • an error code (value greater than 0) otherwise.
<Drive Letter>: Character string
Network drive to create in the following format: "<Drive Letter>:".
<Network Directory>: Character string
Network directory that must be associated with the network drive.
<Options>: Optional Integer constant
Versions 25 and later
Sets the persistence of the connection:
ncOptionNoneNo persistence option.
ncOptionPersistent
(default value)
Persistent connection (the connection remains after restarting the computer).
New in version 25
Sets the persistence of the connection:
ncOptionNoneNo persistence option.
ncOptionPersistent
(default value)
Persistent connection (the connection remains after restarting the computer).
Sets the persistence of the connection:
ncOptionNoneNo persistence option.
ncOptionPersistent
(default value)
Persistent connection (the connection remains after restarting the computer).
<User>: Optional character string
Name of user allowed to access the specified directory. This parameter corresponds to Null by default.
<Password>: Optional character string
Password used to access the specified directory. If <User> corresponds to the name of the current user, the password is ignored by Windows. This parameter corresponds to an empty string ("") by default.
Remarks

Error codes

The following error codes are returned:
  • 1: The connection is not supported.
  • 2: Insufficient memory.
  • 3: Wrong pointer.
  • 4: Wrong type of device.
  • 5: Wrong user profile.
  • 7: An entry is already found for this device in the user profile (Already connected)
  • 8: Invalid network or wrong path.
  • 9: No network.
  • 10: Network error.
  • 11: Wrong network name.
  • 12: The drive letter is invalid.
  • 13: Wrong password.
  • 14: Access denied.
The message corresponding to the error code can be known thanks to the function ErrorInfo with the constant errMessage.

Use in Windows Vista (and later)

In Windows Vista (and later), when the application is started in "Administrator" mode, the network connections may be lost for the application. Indeed, if UAC system is enabled, network drives are disconnected when the user's privileges are increased. In order to use them, it is necessary to reconnect them specifically with the NetworkConnectfunction.
Business / UI classification: Business Logic
Component: wd270std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment