Platforms to show: All Mac Windows Linux Cross-Platform
/SQL/SQLDatabaseMBS SQLite Encryption Fetch values
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 SQLite Encryption Fetch values
This example is the version from Thu, 13th Dec 2017.
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 MySQL Fetch blob
- /SQL/SQLDatabaseMBS MySQL Fetch values
- /SQL/SQLDatabaseMBS ODBC Connect
- /SQL/SQLDatabaseMBS Oracle Connect
- /SQL/SQLDatabaseMBS PostgreSQL Connect
- /SQL/SQLDatabaseMBS PostgreSQL Notify and Listen
- /SQL/SQLDatabaseMBS SQL Anywhere Connect
- /SQL/SQLDatabaseMBS SQLite Blob test
- /SQL/SQLDatabaseMBS SQLite ExecuteSQL
- /SQL/SQLDatabaseMBS SQLite Fetch values
The items on this page are in the following plugins: MBS SQL Plugin.