Platforms to show: All Mac Windows Linux Cross-Platform

Back to SQLConnectionMBS class.

SQLConnectionMBS.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.

SQLConnectionMBS.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.

SQLConnectionMBS.Commit

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Saves any changes and ends the current transaction.

Use Commit method to write transaction changes permanently to a database. It commits the work of all commands that associated with that connection.

All changes to the database since the last commit are made permanent and cannot be undone. Before a commit, all changes made since the start of the transaction can be rolled back using Rollback method.

SQLConnectionMBS.Connect(DBString as string, UserID as string, Password as string, client as Integer = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Opens the connection to a data source.
Example
Var con as SQLConnectionMBS// your connection

// some calls for MS SQL Server:
con.Connect("srv2@pubs","", "", SQLConnectionMBS.kSQLServerClient)
con.Connect("@pubs", "", "", SQLConnectionMBS.kSQLServerClient)
con.Connect("BEDLAM\SQL2005EX_EN@pubs", "", "", SQLConnectionMBS.kSQLServerClient)
con.Connect("BEDLAM\SQLEXPRESS@master", "", "", SQLConnectionMBS.kSQLServerClient)

// for MySQL:

con.Connect("192.168.1.80,3306@test","root","password", SQLConnectionMBS.kMySQLClient)

// for Postgre SQL:

con.Connect("somedb", "name", "password",SQLConnectionMBS.kPostgreSQLClient)
// with options
con.Connect("127.0.0.1,5432@dbname=postgres connect_timeout=10 sslmode=require", "name", "password",SQLConnectionMBS.kPostgreSQLClient)

// for SQLite:

con.Connect("/test.db", "", "",SQLConnectionMBS.kSQLiteClient)

DBString:Name of database this connection will connect to (see Server specific notes).
UserID:A string containing a user name to use when establishing the connection (see Server specific notes).
Password:A string containing a password to use when establishing the connection.
client:Optional. One of the following values from k*Client constants.

Using the Connect method on a SAConnection object establishes the physical connection to a data source. After this method successfully completes, the connection is live and you can issue commands against it and process the results.

If you use the default value of Client parameter, you should set Client before using Connect.

To check whether a connection established use isConnected method. To check whether a connection is broken or not use isAlive method.

see also for server specific notes:
https://www.sqlapi.com/ApiDoc/class_s_a_connection.html

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.

See Option() for various options you can set before connecting.
e.g. c.Option("SQLiteVFSFlags") = "1" for SQLite for read only access.

Raises OutOfBoundsException exception if client parameter is out of range.

SQLConnectionMBS.ConnectMT(DBString as string, UserID as string, Password as string, client as Integer = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SQL MBS SQL Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Opens the connection to a data source.

DBString:Name of database this connection will connect to (see Server specific notes).
UserID:A string containing a user name to use when establishing the connection (see Server specific notes).
Password:A string containing a password to use when establishing the connection.
client:Optional. One of the following values from k*Client constants.

Using the Connect method on a SAConnection object establishes the physical connection to a data source. After this method successfully completes, the connection is live and you can issue commands against it and process the results.

If you use the default value of Client parameter, you should set Client before using Connect.

To check whether a connection established use isConnected method. To check whether a connection is broken or not use isAlive method.

see also for server specific notes:
https://www.sqlapi.com/ApiDoc/class_s_a_connection.html

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

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.

The MT method will not trigger WillConnect and DidConnect events.
Raises OutOfBoundsException exception if client parameter is out of range.

SQLConnectionMBS.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.

SQLConnectionMBS.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.

SQLConnectionMBS.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:

SQLConnectionMBS.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:

SQLConnectionMBS.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...