tags:

views:

92

answers:

2

The problem I'm running into is that when using "MyDB.sqlite" the application seems to not read the DB correctly (stops, NOT errors, at this line according to NSLogs):

if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {

whereas if I rename the DB "MyDB.sql" (notice the lack of "ite") it will read the DB just fine. Did I import the DB incorrectly somehow? Am I using the wrong library? I did add the sqlite framework and imported it in the header file as follows:

#import <sqlite3.h>
+1  A: 

It sounds like, at least in this context, the iPhone (or SQLite) only supports three character extensions on the file name. Is that a deal-breaker?

Robert Harvey
Do you think there is a difference between the sim and device?
Ron Srebro
Hard to say. There is always the possibility, since the sim and the device are not the same. Ideally the sim is running the same code as the device (in a desktop runtime), but even that is not a guarantee.
Robert Harvey
+1  A: 

I'm using sqlite as extension for my db file, so there shouldn't be any problem with that. Why don't you provide more details like where you actually provide the file path. Most probably you're just missing some minor and annoying detail somewhere.

Ron Srebro
I haven't tested the application on the iPhone itself yet, just on the simulator so it might only work on the simulator.
Ron Srebro
I'm on the sim right now, and I've seen code using the .sqlite so I'm assuming it isn't a fluke and I've just done something wrong somewhere. It's just really odd it would read one extension and not the other. I'll go over some other tutorials on linking the library again.
Organiccat