Contents Up Previous Next

wxDatabase is-a wxObject

Database classes overview


Not yet implemented.

Every database object represents an ODBC connection. The connection may be closed and reopened.

wxDatabase close
wxDatabase create
wxDatabase delete
wxDatabase error-occurred
wxDatabase get-database-name
wxDatabase get-data-source
wxDatabase get-error-code
wxDatabase get-error-message
wxDatabase get-error-number
wxDatabase is-open
wxDatabase open


wxDatabase close

bool ( close)

Resets the statement handles of any associated recordset objects, and disconnects from the current data source.


wxDatabase create

long ( database-create)

Creates a new ODBC database handle. The constructor of the first wxDatabase instance of an application initializes the ODBC manager.


wxDatabase delete

bool ( delete)

Destructor. Resets and destroys any associated wxRecordSet instances.

The destructor of the last wxDatabase instance will deinitialize the ODBC manager.


wxDatabase error-occurred

bool ( error-occurred)

Returns 1 if the last action caused an error.


wxDatabase get-database-name

string ( get-database-name)

Returns the name of the database associated with the current connection.


wxDatabase get-data-source

string ( get-data-source)

Returns the name of the connected data source.


wxDatabase get-error-code

string ( wxDatabase get-error-code)

Returns the error code of the last ODBC function call. This will be a string containing one of:

SQL_ERROR General error.
SQL_INVALID_HANDLE An invalid handle was passed to an ODBC function.
SQL_NEED_DATA ODBC expected some data.
SQL_NO_DATA_FOUND No data was found by this ODBC call.
SQL_SUCCESS The call was successful.
SQL_SUCCESS_WITH_INFO The call was successful, but further information can be obtained from the ODBC manager.


wxDatabase get-error-message

string ( get-error-message)

Returns the last error message returned by the ODBC manager.


wxDatabase get-error-number

long ( get-error-number)

Returns the last native error. A native error is an ODBC driver dependent error number.


wxDatabase is-open

bool ( is-open)

Returns 1 if a connection is open.


wxDatabase open

bool ( open string datasource optional long exclusive = 1 optional string readonly = 1 optional string username = "ODBC" optional string password = "")

Connect to a data source. datasource contains the name of the ODBC data source. The parameters exclusive and readonly are not used.