VC用SQLite删除Publish表中所有内容,代码如下:
- C/C++ code
char *pErrMsg = NULL; const char *pzTail = NULL; sqlite3 *pSqlite3; sqlite3_stmt *Stmt; sqlite3_open16(theApp.m_DatabaseFilePath, &pSqlite3); int ret = sqlite3_exec(pSqlite3, "begin immediate", NULL, NULL, &pErrMsg); int ret1 = sqlite3_exec(pSqlite3, "delete from Publish", NULL, NULL, &pErrMsg); int ret2 = sqlite3_exec(pSqlite3, "commit", NULL, NULL, &pErrMsg);
返回:ret=0;ret1=0;ret2=5, pErrMsg=database is locked!
ret2总是返回5是怎么回事?请懂的大哥指教指教,谢谢先!
------解决方案--------------------
JF