Platforms to show: All Mac Windows Linux Cross-Platform
/SQL/SQLDatabaseMBS SQLite Encryption Fetch values
Required plugins for this example: MBS SQL Plugin
Last modified Thu, 13th Dec 2017.
You find this example project in your MBS Xojo Plugin download as a Xojo project file within the examples folder: /SQL/SQLDatabaseMBS SQLite Encryption Fetch values
Download this example: SQLDatabaseMBS SQLite Encryption Fetch values.zip
Project "SQLDatabaseMBS SQLite Encryption Fetch values.xojo_binary_project"
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
End Project
See also:
- /SQL/SQLDatabaseMBS CubeSQL prepared statement
- /SQL/SQLDatabaseMBS Microsoft SQL Connect and query version
- /SQL/SQLDatabaseMBS Microsoft SQL Server Data Types
- /SQL/SQLDatabaseMBS MySQL Fetch values
- /SQL/SQLDatabaseMBS ODBC Connect
- /SQL/SQLDatabaseMBS Oracle Connect
- /SQL/SQLDatabaseMBS SQLite Connect console
- /SQL/SQLDatabaseMBS SQLite ExecuteSQL with Workers
- /SQL/SQLDatabaseMBS SQLite load extension
- /SQL/SQLDatabaseMBS SQLite Test
Download this example: SQLDatabaseMBS SQLite Encryption Fetch values.zip
The items on this page are in the following plugins: MBS SQL Plugin.