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

SQL Anywhere 17 » UltraLite - C++ Programming » Application development » UltraLite C++ application development using Embedded SQL

UltraLite database connection using Embedded SQL

To connect to an UltraLite database from an Embedded SQL application, include the EXEC SQL CONNECT statement in your code after initializing the SQLCA.

The CONNECT statement has the following form:

EXEC SQL CONNECT USING
'uid=user-name;pwd=password;dbf=database-filename';

The connection string (enclosed in single quotes) may include additional database connection parameters.

If you want more than one database connection in your application, you can either use multiple SQLCAs or you can use a single SQLCA to manage the connections.

Use a single SQLCA

You can use a single SQLCA to manage multiple connections to a database.

Each SQLCA has a single active or current connection, but that connection can be changed. Before executing a command, use the SET CONNECTION statement to specify the connection on which the command should be executed.