Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » UltraLite - C and C++ Programming » API Reference » UltraLite C++ API reference » UltraLite_DatabaseManager_iface class

 

OpenConnection function

Opens a new connection to an existing database.

Syntax
UltraLite_Connection * UltraLite_DatabaseManager_iface::OpenConnection(
  ULSqlcaBase & sqlca,
  ULValue const & parms_string
)
Parameters
  • sqlca   The initialized sqlca to associate with the new connection.

  • parms_string   The connection string.

Remarks

The given sqlca is associated with the new connection.

  • SQLE_CONNECTION_ALREADY_EXISTS - A connection with the given SQLCA and name (or no name) already exists. Before connecting you must disconnect the existing connection, or specify a different connection name with the CON parameter.

  • SQLE_INVALID_LOGON - You supplied an invalid user ID or an incorrect password.

  • SQLE_INVALID_SQL_IDENTIFIER - An invalid identifier was supplied through the C language interface. For example, you may have supplied a NULL string for a cursor name.

  • SQLE_TOO_MANY_CONNECTIONS - You exceeded the number of concurrent database connections.

To get error information, use the associated ULSqlca class object. Possible errors include:

Returns
  • If the function succeeds, a new connection object is returned.

  • If the function fails, NULL is returned.