DBKit How to Connect to a persistent sqlite database

Both the documentation and the YouTube tutorial for DBKit use the statement db.Connected(SpecialFolder.Resources.child(“EddiesElectronics.sqlite”)), assuming that this file is copied into the Resources folder for each application run —hence, all changes made with the previous application instance are lost. How do I change the connection statement to access the SQLite file in a place that will allow the changes to remain persistent and that I can also access with Navicat SQLite for other database maintenance?

You could use instead db.Connected(SpecialFolder.SharedApplicationData.child(“EddiesElectronics.sqlite”))
but you’d also need to copy the database there first.

Thank you for your suggestion. But I am still confused as to just what this “SpecialFolder.SharedApplicationData.child” is in relation to a folder I can point to in Finder. In the documentation, it simply states “For SQLite, pass it the database file.” I have tried just entering the file with its path but that has not worked unless I have made an error in the syntax of identifying the path on my Mac. So my question still is, how can I point my Xojo application and Navicat to the same SQLite file and make persistent changes to that file? I am real new to Xojo and the DBKit. I suspect I am misunderstanding something basic here.

While you’re learning try using db.Connected(SpecialFolder.Desktop.Child(“[MyDatabaseFileName]”)) which will place your file on your desktop.
Use Navicat to create your database on your desktop and change [MyDatabaseFileName] above to the file name created with Navicat.

Again, thank you for the suggestion. Using the “Desktop” alternative solved the persistence problem for me. I am still clawing my way through this “SpecialFolder” apparatus and how it is integrated into the macOS and Xojo. What I would eventually like to do is have the SQLite database reside in a designated folder on an external hard drive and have the ability, with an Open File Dialog, to select the desired SQLite file. Assuming both SQLite databases have the same file structure, I could select between the “testing database” and the “production database.” I expect that I will get there eventually. What would be really nice for us novices is a second YouTube documentary on how to expand on the DBKit functionality to incorporate a persistent location for the SQLite database.

Somehow I have been able to accomplish this – a persistent SQLite database accessed via an OpenFileDialog with the file located on my external hard drive.
This was accomplished via the YouTube “Using DBKit to easily connect databases to Xojo applications”; and
the YouTube " Connecting to a Database from Xojo"
and the example code from Databases>>SQLiteDatabase for connecting to an existing SQLite database using the ShowOpenfileDialog(“”)

My code in the App Opening event that works for me:

db = New DBKit.TableConnection
Var dbFile As FolderItem = FolderItem.ShowOpenFileDialog(“”)

If dbFile <> Nil And dbFile.Exists Then
If db.Connected(dbFile) Then
Var w As New Window1
MessageBox(“The database could not be reached due to an error.”)
End If
End If