PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • How to use the gpwOpen function?
  • Cached sessions
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
gpwOpen (Function)
In French: gpwOuvre
AjaxNot available
ODBCOLE DBNot available with these kinds of connection
Opens the login window or page of user groupware.
Note: This function is required only if the user groupware was integrated with the "Manual run" option. This function is ignored if the "Automatic run" option was selected.
Example
// Opens the login window of user groupware
nRes is int = gpwOpen("c:\GpwUser")
// If the login failed
IF nRes <> gpwOk THEN
SWITCH nRes
CASE gpwCancel: Info("The Cancel button was clicked.")
CASE gpwError: Error("Error while initializing the groupware.")
CASE gpwUnknownUser: Error("Unknown user.")
CASE gpwInvalidPassword: Error("Invalid password")
END
EndProgram()
END
// Retrieve the first name of user
FirstName is string = gpwGetUserInfo(gpwInfoFirstName)
Info("Welcome" + FirstName)
Syntax
Versions 18 and later

Syntax of new user groupware Hide the details

<Result> = gpwOpen([<Directory of Groupware Files>])
<Result>: Integer constant
Result regarding the opening of login window/page.
gpwCancelThe user clicked the "Cancel" button found in the login window of Groupware.
gpwErrorAn error occurred. To find out the error details, use ErrorInfo.
gpwInvalidPasswordThe password is not valid. It does not correspond to the user password described in the groupware database.
gpwOkThe user is connected.
gpwUnknownUserThe user is not referenced in the database of user groupware.
<Directory of Groupware Files>: Optional character string (with quotes)
These data files are used to manage the users and their rights. By default, these data files are created in a sub-directory of your project (EXE\GPW_<Project Name> directory).
HFSQL Client/Server By default, these data files are created on the server in a sub-directory of your database: directory .\GPW_<Project Name>.

If this parameter corresponds to an empty string ("") or if it is not specified, the default directory of the user groupware will be used.
HFSQL Client/Server If this parameter corresponds to a dot ("."), the data files of user groupware will be created on the server at the root of database.
New in version 18

Syntax of new user groupware Hide the details

<Result> = gpwOpen([<Directory of Groupware Files>])
<Result>: Integer constant
Result regarding the opening of login window/page.
gpwCancelThe user clicked the "Cancel" button found in the login window of Groupware.
gpwErrorAn error occurred. To find out the error details, use ErrorInfo.
gpwInvalidPasswordThe password is not valid. It does not correspond to the user password described in the groupware database.
gpwOkThe user is connected.
gpwUnknownUserThe user is not referenced in the database of user groupware.
<Directory of Groupware Files>: Optional character string (with quotes)
These data files are used to manage the users and their rights. By default, these data files are created in a sub-directory of your project (EXE\GPW_<Project Name> directory).
HFSQL Client/Server By default, these data files are created on the server in a sub-directory of your database: directory .\GPW_<Project Name>.

If this parameter corresponds to an empty string ("") or if it is not specified, the default directory of the user groupware will be used.
HFSQL Client/Server If this parameter corresponds to a dot ("."), the data files of user groupware will be created on the server at the root of database.

Syntax of new user groupware Hide the details

<Result> = gpwOpen([<Directory of Groupware Files>])
<Result>: Integer constant
Result regarding the opening of login window/page.
gpwCancelThe user clicked the "Cancel" button found in the login window of Groupware.
gpwErrorAn error occurred. To find out the error details, use ErrorInfo.
gpwInvalidPasswordThe password is not valid. It does not correspond to the user password described in the groupware database.
gpwOkThe user is connected.
gpwUnknownUserThe user is not referenced in the database of user groupware.
<Directory of Groupware Files>: Optional character string (with quotes)
These data files are used to manage the users and their rights. By default, these data files are created in a sub-directory of your project (EXE\GPW_<Project Name> directory).
HFSQL Client/Server By default, these data files are created on the server in a sub-directory of your database: directory .\GPW_<Project Name>.

If this parameter corresponds to an empty string ("") or if it is not specified, the default directory of the user groupware will be used.
HFSQL Client/Server If this parameter corresponds to a dot ("."), the data files of user groupware will be created on the server at the root of database.

Syntax of the former user groupware (kept for backward compatibility) Hide the details

<Result> = gpwOpen([<Directory of Rights File>] [, <Directory of User Files>])
<Result>: Integer constant
Result regarding the opening of login window/page.
gpwCancelThe user clicked the "Cancel" button found in the login window of Groupware.
gpwErrorAn error occurred. To find out the error details, use ErrorInfo.
gpwInvalidPasswordThe password is not valid. It does not correspond to the user password described in the groupware database.
gpwOkThe user is connected.
gpwUnknownUserThe user is not referenced in the database of user groupware.
<Directory of Rights File>: Optional character string (with quotes)
These data files are used to manage the rights granted to the users for the different windows of the application. These files are specific to the application. By default, these data files are created in a sub-directory of your project (EXE\GPW_<Project Name> directory).
HFSQL Client/Server By default, these data files are created on the server in a sub-directory of your database: directory .\GPW_<Project Name>.

If this parameter corresponds to an empty string ("") or if it is not specified, the default directory of the user groupware will be used.
HFSQL Client/Server If this parameter corresponds to a dot ("."), the data files of user groupware will be created on the server at the root of database.
<Directory of User Files>: Optional character string (with quotes)
These data files can be common to several applications. By default, these data files are created in a sub-directory of your project (EXE\GPW_<Project Name> directory). You can define the location of the user groupware files common to several applications. In this case, you must specify the path of data files to use.
HFSQL Client/Server By default, these data files are created on the server in a sub-directory of your database: directory .\GPW_<Project Name>.

If this parameter corresponds to an empty string ("") or if it is not specified, the default directory of the user groupware will be used.
HFSQL Client/Server If this parameter corresponds to a dot ("."), the data files of user groupware will be created on the server at the root of database.
Remarks

How to use the gpwOpen function?

gpwOpen is used to customize the start mode of user groupware. This allows you to run code lines, to open windows or pages, ... before opening the connection window or page of user groupware.
Example for using this function: in a multilingual application that is using the user groupware, the first window or page of the application is used to choose the runtime language. When creating the application, you must:
  • choose not to automatically run the user groupware during its integration
  • open the window or page for language selection as first application window, then call the login window or page with gpwOpen.
Versions 20 and later

Cached sessions

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.
New in version 20

Cached sessions

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.

Cached sessions

If your project is using cached sessions, this function must not be used in the "Initializing the project" process. This function must be used in the "Initializing the project after connection to the site" process.
Components
WINDEVWEBDEV - Server code wd230gpu.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
Exemplo de uso do comando gpwOpen()
//Conexao
ok, ok1, ok2, ok3 is boolean

myConn is Connection
myConn..Provider = hNativeAccessSQLServer
myConn..User = "adriano"
myConn..Password = "adriano@2016"
myConn..Source = "192.168.0.162\projeto01"
myConn..Database = "projeto01"
myConn..Access = hOReadWrite

ok1 = HOpenConnection(myConn)
IF ok1 = False THEN
Info(ErrorOccurred() +" - "+ HErrorInfo())
END


IF gpwInitAnalysis() = False THEN
Error(ErrorInfo())
ok2 = False
ELSE

ok2 = True
IF gpwOpen() = gpwOk
ok3 = True
ELSE
Info(ErrorOccurred() +" - "+ HErrorInfo())
ok3 = False
END

END

NextTitle("Atenção")

IF ok1 = True AND ok2 = True AND ok3 = True THEN //deve dar tudo ok

Info("Conectou com sucesso no banco de dados!")

ELSE

Info("Falha ao tentar conectar no Servidor")

END
BOLLER
Nov. 28 2016