Database
Class Database

PropertyDescription
DatabaseName As StringSpecifies the name of the database that will be connected. This is typically only used by database servers (not SQLite)
Host As StringSpecifies the host address (either a name or IP address) for connecting to a database. This is typically only used by database servers (not SQLite).
Password As StringSpecifies the password (if needed) that is used to connect to the database. This is typically only used by database servers (not SQLite)
Username As StringSpecifies the user name (if needed) that is used to connect to the database. This is typically only used by database servers (not SQLite)


Method PrototypeDescription
Sub Close()Terminates the connection to the database
Sub Commit()Ends a transaction and makes any pending changes permanent
Function Connect() As BooleanInitiates a connection to the database
Function Error() As BooleanReturns True if an error occurred using either SQLExecute() or SQLSelect()
Function ErrorCode() As IntegerReturns the database-specific error code. Only applicable when Error is True.
Function ErrorMessage() As StringReturns the database-specific description of the error. Only applicable when Error is True.
Function FieldSchema( TableName As String ) As RecordSetReturns a RecordSet containing the list of all the columns for the specified table.
Function IndexSchema( TableName As String ) As RecordSetReturns a RecordSet describing indexes in the specified table.
Sub Rollback()Ends a transaction and discards any pending changes.
Sub SQLExecute( Query As String )Executes an SQL command (INSERT, UPDATE, CREATE, etc.)
Function SQLSelect( Query As String ) As RecordSetExecutes and SQL SELECT command. SQL is database-specific.
Function TableSchema() As RecordSetReturns a RecordSet containing the list of all the tables in the database.


The Database class cannot usefully be subclassed by your code. The built-in database subclasses (MySQLDatabase, PostgreSQLDatabase, REALSQLDatabase and SQLiteDatabase) are used to connect to specific databases.