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) &&
Ïà¹ØÎÊ´ð£º
string ConStr="data source=C:\ceshi.db;verson=3;password=123456";
SQLiteConnection MyConnection = new SQLiteConnection(ConStr);
try
{ ......
ÎÒÖªµÀ´ó¼Ò¶¼ËµÊÇ64λϵͳϲ»ÄÜÓÃ32λµÄsyste.sqlite.dll¡£Õâ¸öÎÒÒѾ»»ÁË
VS2008ÖÐÔËÐж¼Ã»ÎÊÌ⣨ͬһϵͳÏ£©
Ò»·Åµ½IISÖоͱ¨´í£º
δÄܼÓÔØÎļþ»ò³ÌÐò¼¯¡°System.Data.SQLite¡±»òËüµÄijһ¸öÒÀÀµÏî¡£ÊÔͼ¼ÓÔØ¸ ......
ÎÒÏëÔÚpdaÉÏÓÃSQLiteÊý¾Ý¿â£¬ÎÒ³ÌÐòÊÇqtдµÄ£¬µ«ÊÇÎÒÓ¦¸ÃÔõÑù½«SQLiteÒÆÖ²µ½winceƽ̨ÉÏÄØ£¬ÎÒÏÖÔÚÓÐÁËSQLite.dllºÍSQLite.lib£¬Ö®ºóÎÒ½»²æ±àÒëÉú³ÉÁË.exeÎļþ£¬ÎªÊ²Ã´ÔÚÄ£ÄâÆ÷Éϲ»ÄÜÔËÐÐÄØ£¿
ÆÚ´ýןßÊֻشð£¬Ð»Ð» ......
c# + sqlite ³ö´í£¡£¡£¡
File opened that is not a database file
file is encrypted or is not a database
ºÍÒÔǰһÑùµÄд£¬ÔõôÕâ´Î¾ÍÊDz»Ðа¡£¡£¡£¡
ÎÒ¿ì²»ÐÐÁË£¬´ó¼Ò°ï°ïÎÒ°¡£¡£¡£¡
¼û¹ýһƪÎÄÕÂÊÇ˵Õâ¸ö
......