PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Associates a drive with a shared network directory.
Example
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC)
// Associates the letter "E:" with the network directory \\SharedDocuments\Files
ResConnection = NetworkConnect("E:", "\\SharedDocuments\Files")

SWITCH ResConnection
CASE 1
Error("The connection is not supported")
CASE 2
Error("Insufficient memory.")
CASE 3
Error("Wrong pointer.")
CASE 4
Error("Wrong type of device.")
CASE 5
Error("Wrong user profile.")
CASE 7
Error("An entry is already found for this device in the user profile (already connected)")
CASE 8
Error("Invalid network or wrong path.")
CASE 9
Error("No network.")
CASE 10
Error("Network error.")
CASE 11
Error("Wrong network name.")
CASE 12
Error("The drive letter is invalid.")
CASE 13
Error("Wrong password.")
CASE 14
Error("Access denied.")
OTHER CASE
Info("Drive successfully created")
END
Windows Mobile
// Associates the network drive \\SharedDocuments\Files
// No drive letter exists in Pocket PC
ResConnection = NetworkConnect("", "\\SharedDocuments\Files")
Syntax
<Result> = NetworkConnect(<Drive Letter> , <Network Directory> [, <User Name> [, <Password>]])
<Result>: Integer
  • 0 if the connection was established
  • an error code (value greater than 0) otherwise.
<Drive Letter>: Character string (with quotes)
Network drive to create in the following format: "<Drive Letter>:".
Windows Mobile Empty string (""). If this parameter contains a character string, this string is ignored. In Windows for Pocket PC, the notion of drive letter does not exist.
<Network Directory>: Character string (with quotes)
Network directory that must be associated with the network drive.
Windows Mobile The path of the network directory must have the following format: \\Server Name\Share
<User Name>: Optional character string (with quotes)
User allowed to access the specified directory. This parameter corresponds to Null by default.
<Password>: Optional character string (with quotes)
Password used to access the specified directory. If <User Name> 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 is returned by ErrorInfo associated with the errMessage constant.

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 the UAC system is enabled, the network drives are disconnected when the user privileges are increased. To be able to use them, they must be specifically reconnected with NetworkConnect.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
//Mapear , conectar e desconectar rede
//Mapear , conectar e desconectar rede

ResConnection is int= NetworkConnect("M:", "\\Marciano\d")
SWITCH ResConnection
CASE 1 : Error("A conexão não é suportada")
CASE 2 : Error("Memória insuficiente.")
CASE 3 : Error("ponteiro errado.")
CASE 4 : Error("tipo errado de dispositivo")
CASE 5 : Error("perfil de usuário errado.")
CASE 7 : Error("Uma entrada já é encontrada para este dispositivo no perfil do usuário (já conectado)")
CASE 8 : Error("Invalid network or wrong path.")
CASE 9 : Error("Sem rede.")
CASE 10 : Error("Erro de rede.")
CASE 11 : Error("Nome de rede errado.")
CASE 12 : Error("A letra da unidade é inválido.")
CASE 13 : Error("Senha incorreta.")
CASE 14 : Error("Acesso negado.")
OTHER CASE
Info("Conduzir criado com sucesso")
END

//Desconectar
nResDisconnect is int= NetworkDisconnect("M:")
SWITCH nResDisconnect
CASE 16
Error("valor errado para a desconexão")
CASE 17
Error("Conexão usada atualmente")
CASE 18
Error("Um arquivo é aberto, incapaz de desconectar")
CASE 19
Error("Tente desligar sem uma conexão")
OTHER CASE
Info("desconectado com sucesso")
END

//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/09/curso-windev-funcoes-windows-013.html
https://www.youtube.com/watch?v=De3VzI4l480
De matos
Sep. 20 2016