• How to use gpwOpen?
  • Pre-launched sessions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
gpwOpen (Function)
In french: gpwOuvre
AjaxNot available
ODBCOLE DBNot available with these kinds of connection
Opens the User Groupware login window or page.
Remark: This function is required only if the User Groupware was integrated with the "Manual run" option. If the option "Automatic start" has been selected, this function is ignored.
// Opens the User Groupware login window
nRes is int = gpwOpen("c:\GpwUser")
// If the login failed
IF nRes <> gpwOk THEN
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")
// Retrieve the user's first name
FirstName is string = gpwGetUserInfo(gpwInfoFirstName)
Info("Welcome" + FirstName)

Specific syntax for Android and iOS applications Hide the details

gpwOpen(<WLanguage procedure> [, <User database>])
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called when the login window is closed.
This procedure has the following format:
PROCEDURE <Procedure name>(<Connection> is boolean)
The <Connection> is a boolean:
  • True if the user is connected,
  • False if the user is not connected.
<User database>: Integer constant
Database of users and rights to use:
gpwDatabaseDefaultThe database of users and rights depends on the application start mode:
  • if the application is launched in GO mode (Go simulator or Go on phone with WMDev), the test database will be used as the database of users and rights.
  • if the application is launched from the version deployed on the mobile device, or an Android emulator, the production database will be used as the database of users and rights.
gpwDatabaseProductionForces the use of the user and production rights database regardless of the application start mode.
gpwDatabaseTestForces the use of the user and test rights database regardless of the application start mode.

How to use gpwOpen?

gpwOpen allows you to define the User Groupware startup mode. This allows you to perform other actions before opening the User Groupware login window or page: execute code, open windows or pages, etc.
Usage example of this function: in a multilingual application that uses 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.
AndroidiPhone/iPad If the User Groupware is enabled in "Manual run" mode, the following operations must performed:
  • Do not define a first project window.
  • Call gpwOpen in the "Initialization" event of the project.
  • Open the first project window from the WLanguage code of the procedure passed as a parameter to gpwOpen.

Pre-launched sessions

If your project uses pre-launched sessions, this function must not be used in the project initialization event. This function must be used in the "Initializing the project after connection to the site" event.
Business / UI classification: Neutral code
Component: wd280gpu.dll
Minimum version required
  • Version 9
This page is also available for…
Exemplo de uso do comando gpwOpen()
ok, ok1, ok2, ok3 is boolean

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

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

IF gpwInitAnalysis() = False THEN
ok2 = False

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



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

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


Info("Falha ao tentar conectar no Servidor")

28 Nov. 2016