I am working on sqlite and inserting value in database but I am getting Database is locked error Here is my code
-(void)addmoreDATADetails
{
if(addStmt == nil)
{
const char *sql = "insert into moreBankroll(MoreName) Values(?)";
if(sqlite3_prepare_v2(database, sql, -1, &addStmt, NULL) != SQLITE_OK)
NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(database));
}
sqlite3_bind_text(addStmt, 1, [moreName UTF8String], -1, SQLITE_TRANSIENT);
if(SQLITE_DONE != sqlite3_step(addStmt))
{
NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(database));
}
else
{
moreId=sqlite3_last_insert_rowid(database);
}
sqlite3_reset(addStmt);
}
IF I am adding
XYZAppDelegate *appDelegate = (XYZAppDelegate *)[UIApplication sharedApplication].delegate;
dbPath =[appDelegate getDBPath];
if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK)
this in above function it is saying that no Such table moreBankroll
This code is working fine in another project but not in my project , please help
dbPath
? – Phillip Mills