王志刚 wrote:
> Hi, I meet a problem in use c/c++ API to update a row in table.
> all return value means the operate is successful, But the row have no
> change at all.

How do you determine this?

> the main code al follow:
> 
>    wstring sql = L"UPDATE Mail SET [Content] = ?1 [CurrentSize] = ?2
> WHERE [MailID] = ?3;";

There should be a comma after ?1.

Are you sure there actually exists a record with the ID you bind for the third 
parameter? Note that, if there isn't, you won't get any errors - the statement 
simply won't update any rows.

>    sqlite3_stmt *pstmt = NULL;
>    const char *pzTail = 0;
>    int nRes = SQLITE_OK;
>    nRes = sqlite3_prepare16_v2((sqlite3*)pDB, (void**)sql.c_str(),
> sizeof(wchar_t) * sql.length(), &pstmt, 0);

Why do you need to cast pDB? What type is it declared with?

The second parameter of sqlite3_prepare16_v2 is const void*, not void**. Your 
cast looks strange, though harmless. You shouldn't need any cast at all.
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to