SQLConnect

SQLConnect connects to a database and saves information about the connection in the provided connection handle. The handle must be previously allocated using the SQLAllocHandle function.

Syntax:

RETCODE SQLConnect (hConn, dbName, dbNameLen, userName, userNameLen, auth, authLen ) ; 

Arguments :

The arguments for SQLConnect are listed in below table.

Type|NameDescription
SQLHDBChConnNewly allocated connection handle
SQLCHAR *dbNameName of the database to connect
SQLSMALLINTdbNameLenLength of the database name
SQLCHAR *usernameName of the database user
SQLSMALLINTuserNameLenLength of the username
SQLCHAR*authDatabase encryption password
SQLSMALLINTauthLenPassword length

Returns:

SQLConnect returns SQL_SUCCESS if it is successful else SQL_ERROR.

Page last modified on September 25, 2009, at 09:54 AM