SQLite·µ»ØµÄÖÐÎļǼÊÇÂÒÂë
WTL¿ò¼ÜʹÓÃUnicode×Ö·û¼¯
ÓÃÏÂÃ溯Êý²åÈë¼Ç¼
void CMainFrame::Insert()
{
TCHAR query[MAX_PATH] = {0};
_stprintf(query, _T("insert into correct_word values (\'發\',\'»É\');"));
USES_CONVERSION;
stmt = NULL;
result = sqlite3_prepare(_test_db, W2A(query), MAX_PATH, &stmt, NULL);
if( result != SQLITE_OK )
{
MessageBox((TCHAR *)sqlite3_errmsg16(_test_db), _T("Error"), MB_OK);
return ;
}
result = sqlite3_step(stmt);
if( (result != SQLITE_OK) && (result != SQLITE_DONE) && (result != SQLITE_ROW) )
{
MessageBox((TCHAR *)sqlite3_errmsg16(_test_db), _T("Error"), MB_OK);
return ;
}
}
ÔÙʹÓÃÏÂÃ溯Êý²éѯ
TCHAR* CMainFrame::CorrectWord(TCHAR* word)
{
TCHAR query[MAX_PATH] = {0};
TCHAR correct[MAX_PATH] = {0};
_stprintf(query, _T("select CORRECT from correct_word where WRONG like \'%%%s%%\';"), word);
USES_CONVERSION;
stmt = NULL;
result = sqlite3_prepare(_test_db, W2A(query), MAX_PATH, &stmt, NULL);
if( result != SQLITE_OK )
{
MessageBox((TCHAR *)sqlite3_errmsg16(_test_db), _T("Error"), MB_OK);
return FALSE;
}
result = sqlite3_step(stmt);
if( (result != SQLITE_OK) &&
Ïà¹ØÎÊ´ð£º
¿ª·¢ÓïÑÔ£ºevc
Êý¾Ý¿â£ºSQLite
˵Ã÷£ºÓÐÁ½¸ö½çÃæ
½çÃæÒ»¸öÊÇÓÃÀ´½¨Á¢Êý¾Ý¿â£¬²¢ÇÒ½øÐÐÊý¾Ý¹ÜÀí¹¦ÄÜ£¬°üÀ¨ctrlist¿Ø¼þÏÔʾÊý¾Ý¿âÄÚÈÝ£¬Ôö¼Ó£¬É¾³ý£¬Ð޸ĵȹ¦ÄÜ£»
½çÃæ¶þ£¬Êǵ÷ÓÃÊý¾Ý¿â£¬½øÐвéѯ£¬ÏÔʾ½á ......
¹ØÓÚjuliandayº¯ÊýµÄÎÊÌ⣬ÎÒÏÖÔÚ±íAÖÐÒ»¸ö×Ö¶Îbʱ¼äÀàÐÍ£¬ÈçºÎbΪ½ñÌìµÄÊý¾Ý£¿Ð»Ð»
select * from ±íÃû where datediff(d,getdate(),×Ö¶Îb)=0 ÕâÑùÄã¿´Ðв»£¿
ÎÒÓõÄÊÇsqliteÊý¾Ý¿â£¬Ëü²»Ö§³ÖdatediffµÄ¡ ......
c# + sqlite ³ö´í£¡£¡£¡
File opened that is not a database file
file is encrypted or is not a database
ºÍÒÔÇ°Ò»ÑùµÄд£¬ÔõôÕâ´Î¾ÍÊDz»Ðа¡£¡£¡£¡
ÎÒ¿ì²»ÐÐÁË£¬´ó¼Ò°ï°ïÎÒ°¡£¡£¡£¡
¼û¹ýһƪÎÄÕÂÊÇ˵Õâ¸ö
......
¸Õѧsqlite£¬´´½¨Á˸ö±í£¬Í˳ösqliteÓÖÖØдò¿ªºó£¬²éѯ˵ûÓÐÕâ¸ö±í¡£ÔõôÑù²ÅÄܱ£´æÕâ¸ö±íÄØ£¬windowsÏÂ
Ö±½ÓÔËÐÐsqlite3.exe,È»ºó¾Í¾ÍÖ±½Ócreate table TestÁË
Í˳ösqlite3.exe ÖØдò¿ª£¬select¾ÍÌáʾûÓÐÕâ ......