wcDBClose( )

Syntax . . Returns . . Tips . . Program Example . . Related Topics . . A-Z Index . . Home

Closes a managed connection to the database server for the current session.

Example

returnCode = wcDBClose(cntrlHandle, "conn2");

Syntax

int wcDBClose(void *controlHandle, 
              char *conName)
controlHandleThe handle to the control structure.
conNameThe name to associate with the connection. Must be the conName specified in the wcDBOpen( ) call that opened the connection. If you want to close the connection you opened in your AppPages, conName has to be the connection name you use in AppPages, plus the session ID appended at the end.

Returns

0Success.
Error codeFailure or exception. For a list of possible error codes, see Error Messages.

Tips

Program Example

The following code shows how wcDBClose( ) is used in an application.

    wcGetVariable(wcp, "$SESSION_ID", &sessID);

    if (sessID!=NULL)
        sprintf(connName, "MYCONN%s", sessID);
    
    wcDBClose(wcp, connName);

Related Topics

wcAppPageConnName( )
wcDBOpen( )
wcDBSet( )


Top of Page . . Syntax . . Returns . . Tips . . Program Example . . A-Z Index . . Home