sqlite½â¾öÖÐÎÄ·¾¶ÎÊÌâ
// sqlite½â¾öÖÐÎÄ·¾¶ÎÊÌâ,ÒÔÇ°Ñо¿sqliteʱºòÓöµ½µÄÖÐÎÄ·¾¶ÎÊÌâµÄ½â¾ö·½·¨
// AnsiString cbÖеÄ×Ö·û´®Àà,ÆäËü±àÒëÆ÷ÓÃstd::stringÌæ»»¼´¿É.
// MultiByteToWideCharÊÇwindows api
AnsiString fileName;
int strSize = fileName.Length();
char *ansi = new char[strSize+1];
wchar_t *unicode = new wchar_t[strSize+1];
StrCopy(ansi,fileName.c_str());
MultiByteToWideChar(CP_ACP,0,ansi,strSize,unicode,strSize);
sqlite3_open16(unicode,&Sqlitedb);
delete []ansi;
delete []unicode;
Ïà¹ØÎĵµ£º
£¨4£© ÊÂÎñ´¦Àí
sqlite ÊÇÖ§³ÖÊÂÎñ´¦ÀíµÄ¡£Èç¹ûÄãÖªµÀÄãҪͬ²½É¾³ýºÜ¶àÊý¾Ý£¬²»·Â°ÑËüÃÇ×ö³ÉÒ»¸öͳһµÄÊÂÎñ¡£
ͨ³£Ò»´Î sqlite3_exec ¾ÍÊÇÒ»´ÎÊÂÎñ£¬Èç¹ûÄãҪɾ³ý1ÍòÌõÊý¾Ý£¬sqlite¾Í×öÁË1Íò´Î£º¿ªÊ¼ÐÂÊÂÎñ->ɾ³ýÒ»ÌõÊý¾Ý->Ìá½»ÊÂÎ ......
Ö÷Ҫͨ¹ýpragmaÖ¸ÁîÀ´ÊµÏÖ¡£
±ÈÈ磺 ¿Õ¼äÊÍ·Å¡¢´ÅÅÌͬ²½¡¢Cache´óСµÈ¡£
²»Òª´ò¿ª¡£Ç°ÎÄÌá¸ßÁË£¬VacuumµÄЧÂʷdz£µÍ£¡
PRAGMA auto_vacuum;
PRAGMA auto_vacuum = 0 | 1;
²éѯ»òÉèÖÃÊý¾Ý¿âµÄauto-vacuum±ê¼Ç¡£
Õý³£Çé¿öÏ£¬µ±Ìá½»Ò»¸ö´ÓÊý¾Ý¿âÖÐɾ³ýÊý¾ÝµÄÊÂÎñʱ£¬Êý¾Ý¿âÎļþ²»¸Ä±ä´óС¡£Î´Ê¹ÓõÄÎļþÒ³±»±ê¼Ç²¢ÔÚÒÔ ......
zz from https://www.dream4ever.org/showthread.php?t=86440 feuvan @ DRL
ÔÎÄÔÚhttp://sqlitecn.feuvan.net/faq.html
Óï·¨²¿·ÖÕýÔÚ·ÒëÖУ¬¾´ÇëÆÚ´ý
FAQÖÐÎÄ°æ
ÈçºÎ´´½¨×ÔÔö×ֶΣ¿
SQLite Ö§³ÖÄÄЩÊý¾ÝÀàÐÍ£¿
ΪʲôÄÜÏò SQLite Êý¾Ý¿âµÄÕûÐÍ×Ö¶ÎÖвåÈë×Ö·û´®£¿
Ϊʲô SQLite ÈÏΪ±í´ïʽ '0'=='00' ΪÕ棿
......
Ç°Ðò£º
Sqlite3 µÄÈ·ºÜºÃÓá£Ð¡ÇÉ¡¢Ëٶȿ졣µ«ÊÇÒòΪ·Ç΢ÈíµÄ²úÆ·£¬°ïÖúÎĵµ×ܾõµÃ²»¹»¡£ÕâЩÌìÔÙ´ÎÑо¿Ëü£¬ÓÖÓÐһЩÊÕ»ñ£¬ÕâÀï°ÑÎÒ¶Ô sqlite3 µÄÑо¿ÁгöÀ´£¬ÒÔ±¸Íü¼Ç¡£
ÕâÀïҪעÃ÷£¬ÎÒÊÇÒ»¸ö¿çƽ̨רעÕߣ¬²¢²»Ï²»¶Ö»Óà windows ƽ̨¡£ÎÒÒÔÇ°µÄ¹¤×÷¾ÍÊÇΪ unix ƽ̨д´úÂë¡£ÏÂÃæÎÒËùдµÄ¶«Î÷£¬ËäȻûÓÐÑéÖ¤£¬µ«ÊÇÎÒÒѾ¡ ......
¡¾¹¤×÷»·¾³£º»ùÓÚÓÑÉÆÖ®±Ûmini2440¿ª·¢°å+Qtopia2.2°æ±¾+RedHat9+SQLite-3.3.6¡¿
1.QtopiaÖÐʹÓÃSQLite
ÓÉÓÚQt2²»Ö§³ÖÊý¾Ý¿â²Ù×÷£¬£¨Qt3°æ±¾¾ÍÌṩÁËÖ§³ÖÊý¾Ý¿â²Ù×÷µÄÀ࣬µ«ÊÇQtopia2±È½Ï¾µä£¬ÊÇ»ùÓÚQt2µÄ£¬Ã»°ì·¨£¡£©ËùÒÔÔÚQt/Qtopia³ÌÐòÖÐÐèÒªÊý¾Ý¿âʱ£¬¿ÉÒÔ¿¼ÂÇÔÚQtÖÐʹÓÃLinuxϲÙ×÷SQLiteÊý¾Ý¿âµÄ·½·¨¡££¨±í´ïµÄÓе ......