2011-10-17 92 views

回答

0

是不是the documentation有幫助?

我認爲你應該這樣做:

const char* key = [@"BIGSecret" UTF8String]; 
sqlite3_key(database, key, strlen(key)); 
if (sqlite3_exec(database, (const char*) "SELECT count(*) FROM sqlite_master;", NULL, NULL, NULL) == SQLITE_OK) { 
     NSLog(@"db password ok"); 
     //perform operation 

} else { 
     NSLog(@"db password mismatch"); 
} 
sqlite3_close(database); 
+0

順便說一句,我使用的OBJ-C,但我覺得你有這個想法。 –