Database Connection from IDE Run

Dim dbFile As FolderItem Dim db As New SQLiteDatabase dbFile = GetFolderItem("settings.sqlite") db.DatabaseFile = dbFile If db.Connect Then MsgBox("Connected to DB") Else MsgBox("The database couldn't be opened. Error: " + db.ErrorMessage) End If

Trying to connect to a database from the “RUN” inside the IDE…

Now if I compile the application and the database file is there, it is fine.
But isn’t there a way to have it work when you click RUN and just testing the application from the IDE?

Add a post build copy step to copy the database file to the debug build location. See http://developer.xojo.com/userguide/build-automation

or better yet, place your DB in the preferred location:
SpecialFolder.ApplicationData.Child(“Your Company”).Child((“settings.sqlite”)
Then its in place for your debug runs, your compiled app, and future updates without losing the user’s previous data.

Thanks guys!

You might also find the Connecting to Databases webinar useful.