Difference between revisions of "OpenDBX/C API/odbx init"
From Linuxnetworks
(→Errors:) |
(see also) |
||
| Line 31: | Line 31: | ||
* -ODBX_ERR_NOTEXIST: Backend library was not found | * -ODBX_ERR_NOTEXIST: Backend library was not found | ||
* -ODBX_ERR_NOOP: A function does not exist in the backend | * -ODBX_ERR_NOOP: A function does not exist in the backend | ||
| + | |||
| + | = See also: = | ||
| + | |||
| + | * [[OpenDBX_error]] | ||
| + | * [[OpenDBX_error_type]] | ||
| + | * [[OpenDBX_get_option]] | ||
| + | * [[OpenDBX_set_option]] | ||
| + | * [[OpenDBX_bind]] | ||
---- | ---- | ||
Back to [[OpenDBX API|Overview]] | Back to [[OpenDBX API|Overview]] | ||
Revision as of 10:28, 13 February 2007
int odbx_init(
odbx_t** handle,
const char* backend,
const char* host,
const char* port )
Description:
Allocates and initializes the opaque object for connecting to the database server. The pointer to the newly created object is stored in handle and it can be used in all further OpenDBX functions not related to result processing.
Parameters:
- handle: Pointer where the newly allocated connection object should be stored
- backend: Name of the backend you want to use (mysql, pgsql, sqlite and sqlite3 - depends on the installed libraries)
- host: Host name or IP address of the database server or path to database file
- port: Port number the database server is listening to
Return values:
- ODBX_ERR_SUCCESS on success
- Less than zero if an error occured
Errors:
- -ODBX_ERR_BACKEND: Any error returned by the backend
- -ODBX_ERR_PARAM: "handle" is NULL
- -ODBX_ERR_NOMEM: Allocating new memory failed
- -ODBX_ERR_TOOLONG: The length of a string exceeded the buffer size
- -ODBX_ERR_NOTEXIST: Backend library was not found
- -ODBX_ERR_NOOP: A function does not exist in the backend
See also:
Back to Overview