Platforms to show: All Mac Windows Linux Cross-Platform

Back to SQLConnectionMBS class.

SQLConnectionMBS.AutoCommit as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
Property SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether autocommit is enabled or disabled for the current connection.
Example
Var con as SQLConnectionMBS // your database connection
con.AutoCommit = SQLConnectionMBS.kAutoCommitOn

If autocommit is on, the database is committed automatically after each SQL command. Otherwise, transaction is committed only after Commit calling.
(Read and Write property)

SQLConnectionMBS.Client as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
Property SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The current DBMS client assigned for the connection.
Example
Var con as new SQLConnectionMBS
con.client = SQLConnectionMBS.kSQLiteClient

Raises OutOfBoundsException exception if value parameter is out of range on setting.
(Read and Write property)

SQLConnectionMBS.ClientVersion as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
Property SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Gets the DBMS client API version number.

The higher word contains the major client version (the XX value in the XX.YY version number); the lower word contains the minor client version (the YY value in the XX.YY version number).

If an DBMS client was not set calling ClientVersion method will throw an exception.
(Read only property)

SQLConnectionMBS.Error as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
Property SQL MBS SQL Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether an error occurred.

This is set always when an error occurs and cleared if no error happened.
Be aware that the next call to a plugin function may reset error status.
If you look on this property in debugger, it's probably already cleared by the debugger querying a property.
(Read only property)

SQLConnectionMBS.ErrorCode as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
Property SQL MBS SQL Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The last error code.

This is set always when an error occurs and cleared if no error happened.
(Read only property)

SQLConnectionMBS.ErrorMessage as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
Property SQL MBS SQL Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The last error message.

This is set always when an error occurs and cleared if no error happened.
(Read only property)

SQLConnectionMBS.isAlive as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
Property SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the database server connection status for a particular connection object.

Returns true if the database server is active and accessible; otherwise false.
This method uses the safe query execution for most supported DBMS-es. The query uses the well known database table or procedure (mysql_ping is used for MySQL or MariaDB). If the query fails the method returns false.
(Read only property)

SQLConnectionMBS.isConnected as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
Property SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the connection state for a particular connection object.

Returns true if connected; otherwise false.
(Read only property)

SQLConnectionMBS.IsolationLevel as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
Property SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The transaction isolation level.
Example
Var con as SQLConnectionMBS // your connection
con.IsolationLevel = SQLConnectionMBS.kReadUncommitted

Use the kReadCommitted, kReadUncommitted, kRepeatableRead, kSerializable and kLevelUnknown constants.
(Read and Write property)

SQLConnectionMBS.LastStatement as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SQL MBS SQL Plugin 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The last executed SQL Statement.

(Read only property)

SQLConnectionMBS.NativeAPI as Variant   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
Property SQL MBS SQL Plugin 9.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used.
Returns a set of functions of native DBMS client API.

Returns a SQLAPIMBS object.
Deprecated in version 19.5 in favor of direct methods in SQLDatabaseMBS and SQLConnectionMBS classes.
(Read only property)

SQLConnectionMBS.Options as Dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SQL MBS SQL Plugin 18.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns a dictionary with all options.

For debugging, it may be useful to inspect options in debugger.
(Read only property)

SQLConnectionMBS.RaiseExceptions as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SQL MBS SQL Plugin 14.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether to raise exceptions.

Default is true which means we set error, ErrorCode and ErrorMessage properties and than raise SQLErrorExceptionMBS exception.
If you set to false, we don't raise the exception and you have similar behavior as with database class.
We recommend to use exceptions as they are not so easily ignored like an error property being true.
(Read and Write property)

SQLConnectionMBS.RowsAffected as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SQL MBS SQL Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns number of rows affected by last DML operation.

Returns the number of rows affected by the last insert/update/delete command execution.

Can also return the result set rows count, usually when the result set is cached at the client side.
(Read only property)

SQLConnectionMBS.Scrollable as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SQL MBS SQL Plugin 14.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether to make internally created SQLCommand objects scrollable.

Since plugin version 15.0, Scrollable is false by default.
(Read and Write property)

SQLConnectionMBS.ServerVersion as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
Property SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Gets the currently connected DBMS server version number.

The higher word contains the major server version (the XX value in the XX.YY version number); the lower word contains the minor server version (the YY value in the XX.YY version number).
(Read only property)

SQLConnectionMBS.ServerVersionString as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
Property SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Gets the currently connected DBMS server version string.

A server version string may contain some useful information about server brand, configuration and so on. It is a good idea to display this information in all your applications.
(Read only property)

SQLConnectionMBS.SQLiteEncryptionKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SQL MBS SQL Plugin 15.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The encryption key to use.
Example
Var db as new SQLConnectionMBS
db.SQLiteEncryptionKey = "Hello"

This key is applied to the database after connecting. In case of an error, the plugin raises an exception. An empty key can be used for having no encryption.
Alternatively you can use SQLite3MBS.SetKey yourself.

The amount of key material actually used by the encryption extension depends on which variant of SEE you are using. With RC4, the first 256 byte of key are used. With the AES128, the first 16 bytes of the key are used. With AES256, the first 32 bytes of key are used.

If you specify a key that is shorter than the maximum key length, then the key material is repeated as many times as necessary to complete the key. If you specify a key that is larger than the maximum key length, then the excess key material is silently ignored.

The key must begin with an ASCII prefix to specify which algorithm to use. The prefix must be one of "rc4:", "aes128:", or "aes256:". The prefix is not used as part of the key sent into the encryption algorithm. So the real key should begin on the first byte after the prefix. If no prefix is given, we default to AES 128. To be compatible to Xojo, you can use AES128.

The string provided to the plugin is used with it's current encoding. So be sure you use right text encoding for what you want. e.g. using "Müller" as key in text encoding Windows ANSI will not open a database which used that key in UTF-8 encoding.

The Xojo database encryption in SQLiteDatabase class uses AES-128 OFB.
(Read and Write property)

SQLConnectionMBS.Tag as Variant

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SQL MBS SQL Plugin 14.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The tag property.

You can store here whatever you like.
(Read and Write property)

The items on this page are in the following plugins: MBS SQL Plugin.


The biggest plugin in space...