Home How To Online Documentation Support Download Order

 

 

 

SACommand
SAConnection
SAException
SAField
SAParam

SAString
SADateTime
SANumeric
SAInterval

Enums and Typedefs

  

Usage

Class Members

Examples

SAConnection::Connect

void Connect( const SAString &sDBString , const SAString &sUserID , const SAString &sPassword ,
                            SAClient_t
eSAClient = SA_Client_NotSpecified, saConnectionHandler_t fHandler = NULL );  throw (SAException);

Opens the connection to a data source. 

Parameters

sDBString.    Name of database this connection will connect to (see Server Specific Guide).

sUserID.    A string containing a user name to use when establishing the connection.

sPassword.    A string containing a password to use when establishing the connection.

eSAClient.    Optional. One of the following values from SAClient_t enum.

fHandler.   Optional. Allow to define connection process callback function defined as:

        typedef void (SQLAPI_CALLBACK *saConnectionHandler_t)(SAConnection &con, SAConnectionHandlerType_t eHandlerType);

Remarks

Using the Connect method on a SAConnection object establishes the physical connection to a data source. After this method successfully completes, the connection is live and you can issue commands against it and process the results.

If you use the default value of eSAClient parameter, you should call setClient method before using Connect.

To check whether a connection established use isConnected method. To check whether a connection is brocken or not use isAlive method.

See also

isConnected, Disconnect, setClient, setOption

SAClient_t

Error handling

Problems and Questions

If you haven't found the answer to your questions or have some problems on using the Library, please, send e-mail to howto@sqlapi.com.