Platforms to show: All Mac Windows Linux Cross-Platform

Back to SQLDatabaseMBS class.

SQLDatabaseMBS.CancelAllCommands

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 18.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Cancel all commands for the connection.

This loops over the list of commands associated with this connection and calls Cancel on them.

SQLDatabaseMBS.Commands as SQLCommandMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 18.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries list of all command objects related to the connection.

SQLDatabaseMBS.Connect as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Connects to the database.
Example
Var db as new SQLDatabaseMBS

// where is the library?
db.SetFileOption SQLConnectionMBS.kOptionLibraryMySQL, SpecialFolder.UserHome.Child("libmysqlclient.dylib")

// connect to database
// in this example it is MySQL,
// but can also be Sybase, Informix, Oracle, DB2
// SQLServer, InterBase, SQLBase and ODBC

db.DatabaseName="mysql:192.168.1.80,3306@test"

db.UserName="root"
db.Password=""

// or postgreSQL with timeout and ssl mode
db.DatabaseName="PostgreSQL:127.0.0.1,5432@dbname=postgres connect_timeout=10 sslmode=require"

if db.Connect then

MsgBox "We are connected!"

MsgBox "Server Version: "+db.Connection.ServerVersionString

// Disconnect is optional
// autodisconnect will ocur in destructor if needed

else
MsgBox db.ErrorMessage
end if

Returns true on success and false on failure.

Please set the DatabaseName, UserName and Password properties. The Host property is ignored.
The database name must contain the complete information and a prefix for the kind of database.

Use this prefixes: "CubeSQL:", "SQLAnywhere:", "ODBC:", "Oracle:", "SQLServer:", "Firebird:", "DuckDB:", "InterBase:", "SQLBase:", "DB2:", "Informix:", "Sybase:", "MySQL:", "MariaDB:", "PostgreSQL:" or "SQLite:".
Connect to Microsoft Access, FileMaker Server (or Pro), Microsoft Visual FoxPro and others via ODBC.

For IPv6 we changed plugin to use , instead of : for the port separator. So please use , to separate port from IP or host.

For Firebird, if you connect to a database and you have 32/64bit mismatch, you get error number 3.

SQLDatabaseMBS.ConnectMT as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Connects to the database.

Returns true on success and false on failure.

Please set the DatabaseName, UserName and Password properties. The Host property is ignored.
The database name must contain the complete information and a prefix for the kind of database.

Use this prefixes: "CubeSQL:", "SQLAnywhere:", "ODBC:", "Oracle:", "SQLServer:", "Firebird:", "DuckDB:", "InterBase:", "SQLBase:", "DB2:", "Informix:", "Sybase:", "MySQL:", "MariaDB:", "PostgreSQL:" or "SQLite:".
Connect to Microsoft Access, FileMaker Server (or Pro), Microsoft Visual FoxPro and others via ODBC.

For IPv6 we changed plugin to use , instead of : for the port separator. So please use , to separate port from IP or host.

Same as Connect, but if you run this on a thread, the plugin gives time to other threads so the rest of your application runs just fine.

The MT method will not trigger WillConnect and DidConnect events.

The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.

SQLDatabaseMBS.Constructor(globals as SQLGlobalsMBS = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 13.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor.

Please don't call this directly as it's called automatically with using new command.

SQLDatabaseMBS.CubeSQLLastInsertID as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 20.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the last auto increment value from last insert command.

Only for CubeSQL connections. May raise error if not available.

SQLDatabaseMBS.CubeSQLReceiveData(byref data as String, byref IsEndChunk as Boolean) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Receives a data chunk for file download.

Returns true on success.
Data is set with data and IsEndChunk is set to true for last chunk.

SQLDatabaseMBS.CubeSQLSendData(data as MemoryBlock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sends data chunk for file upload.

This is the sendchunk function in CubeSQL.

See also:

SQLDatabaseMBS.CubeSQLSendData(data as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sends data chunk for file upload.

This is the sendchunk function in CubeSQL.

See also:

SQLDatabaseMBS.CubeSQLSendEndData

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sends end data packet.

This is the send_enddata function in CubeSQL.

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


The biggest plugin in space...