You find this example project in your Plugins Download as a Xojo project file within the examples folder: /SQL/
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
// use internal sqlite library
call InternalSQLiteLibraryMBS.Use
dim db as new SQLDatabaseMBS
// where is the library?
'db.SetOption SQLConnectionMBS.kOptionLibrarySQLite, "/usr/lib/libsqlite3.0.dylib"
// connect to database
// in this example it is SQLite,
// but can also be Sybase, Oracle, Informix, DB2, SQLServer, InterBase, MySQL, SQLBase and ODBC
dim f as FolderItem = GetOpenFolderItem("")
if f <> nil then
#if RBVersion >= 2013 then
// Xojo
dim path as string = f.NativePath
#else
// Real Studio
dim path as string = f.UnixpathMBS
#endif
// e.g. "xxx" or "aes128:xxx" or "aes256:xxx" or "rc4:xxx" depending on what you want to use
db.SQLiteEncryptionKey = "xxx"
db.DatabaseName = "sqlite:"+path
if db.Connect then
// you need to change the query for your database
dim r as RecordSet = db.SQLSelect("Select Vorname, Nachname from Addresses")
// fetch results row by row and print results
while not r.EOF
dim Vorname as string = r.Field("Vorname").StringValue
dim Nachname as string = r.Field("Nachname").StringValue
window1.Listbox1.AddRow Vorname, Nachname
r.MoveNext
wend
end if
end if
End EventHandler
End Class
Class Window1 Inherits Window
Control Listbox1 Inherits Listbox
ControlInstance Listbox1 Inherits Listbox
End Control
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