Opens a managed connection to the database server for the current session.
returnCode = wcDBOpen(cntrlHandle, "conn2", "clients@sirius", "user76", "pass76");
int wcDBOpen(void *controlHandle, char *conName, char *server, char *userID, char *passwd)
controlHandle | The handle to the control structure. |
conName | The name to associate with the connection. Must be only alphanumeric and underscore (_) characters, with a maximum of 18 characters. Use the connection name returned by wcAppPageConnName() to open a connection to the AppPages repository. If you want to use the connection in your AppPages, conName has to be the connection name you use in AppPages, plus the session ID appended at the end. See Tips section for more information. |
server | The database name, server name, or both for the connection. Syntax is databaseName@serverName. |
userID | The database user ID which is requred to log in to the database. |
passwd | The password for the database user. |
0 | Success. |
Error code | Failure or exception. For a list of possible error codes, see Error Messages. |
The following code shows how wcDBOpen( ) is used in an application.
wcGetVariable(wcp, "$SESSION_ID", &sessID); if (sessID!=NULL) sprintf(connName, "MYCONN%s", sessID); wcDBOpen(wcp, connName, dbname, dbuser, dbpass);
wcAppPageConnName( )
wcDBClose( )
wcDBSet( )