一.sqlite3 close returns error code 5
Thesqlite3_close
documenationstates it clearly:
Applications must finalize all prepared statements and close all BLOB handles associated with the sqlite3 object prior to attempting to close the object. If sqlite3_close() is called on a database connection that still has outstanding prepared statements or BLOB handles,then it returns sqlITE_BUSY.
char sql[] = "select PileData.FileID as FileID,PileData.SourceData as SourceData,PileFile.SaveTime as SaveTime from PileData inner join PileFile on PileData.FileID=PileFile.FileID where PileFile.Upload=0 limit 1"; CRsQuery result = db.execQuery(sql); if(result.eof())//没找到未发送的文件 { result.finalize();//增加该语句 db.close(); return FALSE; }