Having trouble connecting to a existing embedded SQLite database. Have tried many examples but nothing works.
I need example code that will connect with the database. Preferably in the current application.
'mDB = new SQLiteDatabase
'//var f as FolderItem
'//f = App.ExecutableFile.Parent.Parent.Child(“Resources”).Child(“Parts.sqlite”)
'dim f as xojo.IO.FolderItem = Xojo.IO.SpecialFolder.GetResource(“Parts.sqlite”)
’
'if f <> Nil and f.Exists then
'try
'mDB.DatabaseFile=f
'if mDB.Connect then
'var rs as RowSet= mDB.SelectSQL(“select * form Main”)
'end if
'end Try
'end if
FolderItem.DriveAt(0).Constructor
dim db as SQLiteDatabase
if db.Connect then
dim rs as RecordSet = db.SQLSelect(“SELECT sqlite_version()”)
if rs <> nil then
MessageBox(rs.idxField(1).stringValue)
end if
end if