If I create a sql lite database and drag it into xojo, Xojo will show the tables and fields, but any attempt to run the app gives a “Can’t find a type with this name”
If I use copyfiles to copy the database to the resources folder, i can access and read the database but not right to it.
I cant seem to find a way to copy a database onto the device and access it read/write.
you can include database as a template in your resources. For that don’t drag it to project, but copy with build step.
On first launch of app, copy database template into users documents or preferences folder, so you can write to it.
Stuff in resources folder is read only!
You definitely have to copy it out of the Resources in the bundle before you can write to it. To do so, use SpecialFolder.GetResource to get a FolderItem that you can copy elsewhere:
[code]Dim bundleFile As Folderitem
bundleFile = SpecialFolder.GetResource(“AppDatabase.sqlite”)
Dim newFile As FolderItem = SpecialFolder.Documents.Child(“MyAppDb.sqlite”)
bundleFile.CopyTo(newFile)[/code]
Thanks Wayne. I did indeed have a copyfile step. Just realized my problem was that I was not checking whether the file already existed in that place, and the IOException was that it was trying to copy over an existing file. My bad for wasting your guys bandwidth on a simple question that was clear after a night’s sleep!