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) &&
Ïà¹ØÎÊ´ð£º
´ó¼ÒºÃ£¡
sqlite×Ö¶ÎΪfloatÐ͵ÄÖµÔõÑù·ÃÎÊ£¿
ÊÔ¹ýÓÃsqlite3_column_double£¬È··µ»ØµÄÊý¾Ý²»ÕýÈ·£»
ûÓùý,°ï¶¥.
Ò»Ñù°¡£¬·µ»ØÈ«ÊÇ string
ÄãµÄ´úÂëÊÇʲô£¿
double sqlite3_column_double(sqli ......
ÄǸö¸ßÊÖ½Ó´¥¹ýsqlite£¬·¢µã¶ÔsqliteµÄÏêϸԴÂë·ÖÎö£¬Ð»Ð»~~
Ô´´úÂëµ¹ÊDz»ÉÙÈËÏÂÁË,Ò²¿´ÁË,µ«ÍêÕûµÄ·ÖÎöûÓÐ.
ÒýÓÃ
Ô´´úÂëµ¹ÊDz»ÉÙÈËÏÂÁË,Ò²¿´ÁË,µ«ÍêÕûµÄ·ÖÎöûÓÐ.
ÓÐûÓÐһЩ¹ØÓÚSQLiteÄÚ´æ·ÖÅä· ......
±ÈÈ磺
1¡¢Á¬½ÓÊý¾Ý¿â£»
2¡¢½¨±í£¬insert ¡¢update,delete,selectÈçºÎд£¿
ÊDz»ÊÇÒªÏÂÔØ ADO.NET 2.0 ÒýÇ棿
sqliteʹÓÃÊÖ²á
ллqshurufa£¬ÎÒÏëÖªµÀÈçºÎͨ¹ývb.netʵÏÖ£¬¾ÍÊÇÓï¾äզд£¿
Dim Conn As New ......