I don't know anything about xcode, but I've been burned by bugs like this in the past. It was always my fault: console was connected to one DB, and my app was connected to another. Make REALLY sure you're using the database file that you think you are.
Doug > -----Original Message----- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Edward Wong > Sent: Monday, June 22, 2009 11:38 AM > To: sqlite-users@sqlite.org > Subject: [sqlite] sqlite3_exec unresponsive for insert, delete and > update > > > hi all, > > i've been banging my head against the keyboard, trying to figure out > what is > going on. i am writing a program in xcode that uses the c/c++ sqlite3 > library. the problem i am having is the following: > > 1. i open a connection to my db using sqlite3_open() > > NSString *dbFile = [[NSBundle mainBundle] > pathForResource:@"data" > ofType:@"db"]; > if (sqlite3_open([dbFile UTF8String], &db) == SQLITE_OK) { > //NSLog(@"SQLite connection open SUCCEEDED!"); > } else { > //NSLog(@"SQLite connection open FAILED!"); > } > > 2. i run a sqlite3_exec function call to either insert,delete or > update > > NSString query = @"delete from table where id =3"; > char *error; > int rc = sqlite3_exec(db, [query UTF8String], NULL, NULL, > &error); > if (rc == SQLITE_OK) { > //debug start > NSLog(@"DBObject.update. SQLITE_OK"); > //debug end > return YES; > } else { > //debug start > NSLog(@"Error: %@", [NSString stringWithUTF8String:error]); > sqlite3_free(error); > //debug end > return NO; > } > > 3. the return value from sqlite3_exec is SQLITE_OK. however, when i > check > the database table nothing has changed. (select sql statements work > fine.) > 4. when i type in the insert, delete or update sql statement into the > console it works fine. > > i don't know what is going on. can anyone please help? thanks so > much!! > > -- > View this message in context: http://www.nabble.com/sqlite3_exec- > unresponsive-for-insert%2C-delete-and-update-tp24150955p24150955.html > Sent from the SQLite mailing list archive at Nabble.com. > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users