Platforms to show: All Mac Windows Linux Cross-Platform
/SQL/SQLDatabaseMBS CubeSQL select version
Required plugins for this example: MBS SQL Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /SQL/SQLDatabaseMBS CubeSQL select version
This example is the version from Tue, 13th May 2019.
Project "SQLDatabaseMBS CubeSQL select version.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
// use internal CubeSQL library
call InternalCubeSQLLibraryMBS.Use
dim db as new SQLDatabaseMBS
db.Option("APPNAME") = "Xojo Test"
db.Option("ConnectionTimeout") = "5" // 5 seconds timeout?
'db.Option("ConnectionEncryption") = "AES128" // or "AES192" or "AES256"
// connect to database
// in this example it is CubeSQL,
// but can also be Sybase, Oracle, Informix, DB2, SQLServer, InterBase, MySQL, SQLBase and ODBC
db.DatabaseName = "cubesql:localhost@mydatabase.sqlite"
db.UserName = "admin"
db.Password = "admin"
if db.Connect then
dim r as RecordSet = db.SQLSelect("select sqlite_version()")
if r = nil or r.eof then
MsgBox "Failed to query version."
else
MsgBox "Version: "+r.IdxField(1).StringValue
end if
else
MsgBox db.ErrorMessage
end if
End EventHandler
End Class
Class Window1 Inherits Window
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project
See also:
- /SQL/SQLDatabaseMBS Firebird Connect
- /SQL/SQLDatabaseMBS Microsoft SQL Connect and query version
- /SQL/SQLDatabaseMBS Microsoft SQL Stored Procedure
- /SQL/SQLDatabaseMBS MSSQL Fetch values
- /SQL/SQLDatabaseMBS MySQL Fetch blob
- /SQL/SQLDatabaseMBS PostgreSQL
- /SQL/SQLDatabaseMBS SQL Anywhere Connect
- /SQL/SQLDatabaseMBS SQLite Encryption Fetch values
- /SQL/SQLDatabaseMBS SQLite insert record
- /SQL/SQLDatabaseMBS SQLite insert record with transaction
The items on this page are in the following plugins: MBS SQL Plugin.