开发者

Check to see if SQLite database connection is still open

how can you check to see if a database is still open?

I am using this to open it:

   if (sqlite3_open([dbPath UTF8String], &database1) == SQLITE_OK) {
}

I assume it would be something like the following, but when I think the database is open it shows as closed: (Am I on the right track or completely wrong here?) :

if(sqlite3_open([dbPath UTF8String], &database1)){

    NSLog(@"DATABASE OPEN?");

}else{

    NSLog(@"DATABASE开发者_StackOverflow社区 CLOSED?");


}


      if(sqlite3_open([temppath UTF8String], &database) == SQLITE_OK)
      {
      NSLog(@"DATABASE OPEN?");
      sqlite3_close(database);
      }
      else
      {
         NSLog(@"DATABASE CLOSED?");
      }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜