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
bool ( close)
Resets the statement handles of any associated recordset objects, and disconnects from the current data source.
long ( database-create)
Creates a new ODBC database handle. The constructor of the first wxDatabase instance of an application initializes the ODBC manager.
bool ( delete)
Destructor. Resets and destroys any associated wxRecordSet instances.
The destructor of the last wxDatabase instance will deinitialize the ODBC manager.
bool ( error-occurred)
Returns 1 if the last action caused an error.
string ( get-database-name)
Returns the name of the database associated with the current connection.
string ( get-data-source)
Returns the name of the connected data source.
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. |
string ( get-error-message)
Returns the last error message returned by the ODBC manager.
long ( get-error-number)
Returns the last native error. A native error is an ODBC driver dependent error number.
bool ( is-open)
Returns 1 if a connection is 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.