did you know you can put things in the Documents folder of your app with iTunes as well… you just need to add a line to the plist.info file to activate file sharing
It is an SQLite database.
It is in the documents folder.
The connect method does not throw an error (according to the docs).
Snippet:
if f1.Exists then
dbg.trace(“assigning file”)
self.db.DatabaseFile = f1
dbg.trace(" assigned")
if db.connect then
dbg.trace(“connected”)
ok = true
end
end
The dbg.trace() calls write to a log. I see " assigned." I do not see “connected.”
I would not expect a crash. I would expect the result to be false.
Hmmm… I use code like this… and it detects attempts to open a non-DB.
If DB.databaseFile.exists=True Then //<==== You don't have this
If DB.Connect=False Then
x=db.ErrorCode
If x=21 Or x=26 Then' File is encrypted or is not a database
Even though this issue has been solved. I was curious as to what was going on.
I put my bad database where it could be opened when running on the simulator. Same problem (which was expected)… So, I wrapped the db.connect() method in try…catch. It still crashed. That is, I am getting an iosSqlitexception but the try…catch seems not to recognize it.