SQL_ConnectCustom Function

Connects to a database using key value pairs containing the database info. The key/value pairs should match what would be in databases.cfg.

I.e. "driver" should be "default" or a driver name (or omitted for the default). For SQLite, only the "database" parameter is needed in addition. For drivers which require external connections, more of the parameters may be needed.

In general it is discouraged to use this function. Connections should go through databases.cfg for greatest flexibility on behalf of users.

Database SQL_ConnectCustom(Handle keyvalues, char[] error, int maxlength, bool persistent)

Parameters

Handle keyvalues

Key/value pairs from a KeyValues handle, describing the connection.

char[] error

Error buffer.

int maxlength

Maximum length of the error buffer.

bool persistent

True to re-use a previous persistent connection if possible, false otherwise.

Return Value

A database connection Handle, or INVALID_HANDLE on failure. On failure the error buffer will be filled with a message.

Errors

Invalid KeyValues handle.