Client-Library now supports the API routine, ct_connect_string().
Connects to a server by specifying a connection string.
The ct_connect_string() function provides the same functionality as ct_connect(). It also provides a mechanism to set certain attributes at connection time.
CS_RETCODE ct_connect_string(connection, connection_string, length) CS_CONNECTION *connection; CS_CHAR *connection_string; CS_INT length;
connection – a pointer to a CS_CONNECTION structure. A CS_CONNECTION structure contains information about a particular client/server connection. Use ct_con_alloc to allocate a CS_CONNECTION structure.
connection_string – a string containing attribute names and values.
length – the length, in bytes, of *connection_string. If *connection_string is null-terminated, pass length as CS_NULLTERM. If connection_string is NULL, pass length as 0 or CS_UNUSED.
ct_connect returns:
Returns |
Indicates |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
CS_PENDING |
Asynchronous network I/O is in effect. See the Asynchronous programming section in the Open Client Client-Library/C Reference Manual. |
CS_BUSY |
An asynchronous operation is already pending for this connection. See the Asynchronous programming section in the Open Client Client-Library/C Reference Manual. |
ct_connect_string(conn, "Username=me; Password=mypassword; Servername=ASE", CS_NULLTERM);