OpenDBX/C API/odbx bind

From Linuxnetworks
< OpenDBX‎ | C API
Revision as of 23:25, 18 January 2007 by Nose (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Available since 1.1.1

int odbx_bind(
    odbx_t* handle,
    const char* database,
    const char* who,
    const char* cred,
    int method ) 

Description:

Opens the database located on the database server specified in odbx_init(). The authentication is done by using the specified method and the given credentials which may be NULL if they are not used by the backend. If any options should be set by odbx_set_option(), it must be done before calling this function.

Rebinding with other parameter and options can be performed by calling this function again after invoking odbx_unbind() before.

Parameters:

  • handle: Connection object created by odbx_init()
  • database: Name of the database
  • who: User to connect to the database
  • cred: Password string for authentication
  • method: Authentication method used for login (currently only ODBX_BIND_SIMPLE)

Errors:

  • -ODBX_ERR_BACKEND: Any error occured in the backend
  • -ODBX_ERR_PARAM: One of the parameters is NULL or handle is invalid
  • -ODBX_ERR_NOMEM: Allocating new memory failed
  • -ODBX_ERR_TOOLONG: The length of a string exceeded the buffer size



Back to Overview