Platforms to show: All Mac Windows Linux Cross-Platform
/SQL/SQLDatabaseMBS Firebird Connect
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 Firebird Connect
This example is the version from Thu, 10th Jan 2018.
Project "SQLDatabaseMBS Firebird Connect.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
dim db as new SQLDatabaseMBS
// where is the library?
// you can place the database client library files where you want.
// example code just has some convenient location for testing.
if TargetWin32 then
db.Option(db.kOptionLibraryFirebird) = "gds32.dll;fbclient.dll"
elseif TargetLinux then
db.Option(db.kOptionLibraryFirebird) = "libgds.so:libfbclient.so"
elseif TargetMachO then
db.Option(db.kOptionLibraryFirebird) = "libgds.dylib:libfbclient.dylib"
else
MsgBox "Platform not supported."
quit
end if
// or with file on disk
'db.SetFileOption SQLConnectionMBS.kOptionLibraryFirebird, SpecialFolder.UserHome.Child("libfbclient.dylib")
// connect to database
// in this example it is Firebird/InterBase,
// but can also be Sybase, Informix, DB2, MySQL
// SQLServer, SQLBase and ODBC
// Read more here: http://www.sqlapi.com/ServerSpecific/InterBase.html
// Please enter values for your server here:
dim ConnectionString as string = "xxx"
// For local databases, this can be a file name.
// To connect to a database on a remote server using TCP/IP the syntax is <server name>:<filename>.
// To connect to a database on a remote server using NetBEUI, the syntax is \\<server name>\<filename>.
// To connect to a database on a remote server using SPX, the syntax is <server name>@<filename>.
dim username as string = "xxx"
dim password as string = "xxx"
db.DatabaseName = "Firebird:" + ConnectionString
db.UserName = username
db.Password = password
if db.Connect then
MsgBox "We are connected!"
dim con as SQLConnectionMBS = db.Connection
MsgBox "Server Version: "+con.ServerVersionString
// Disconnect is optional
// autodisconnect will ocur in destructor if needed
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 DuckDB
- /SQL/SQLDatabaseMBS MSSQL Execute
- /SQL/SQLDatabaseMBS MSSQL Fetch values
- /SQL/SQLDatabaseMBS MySQL Fetch blob
- /SQL/SQLDatabaseMBS PostgreSQL Connect
- /SQL/SQLDatabaseMBS SQLite API 2
- /SQL/SQLDatabaseMBS SQLite Blob test
- /SQL/SQLDatabaseMBS SQLite Connect
- /SQL/SQLDatabaseMBS SQLite ExecuteSQL
- /SQL/SQLDatabaseMBS SQLite load extension
The items on this page are in the following plugins: MBS SQL Plugin.