> and i'm sure there is a record with the ID bind for the third parameter.
You should be also sure that this record contains ID as an integer value, not as text value. Without affinity integer will never be equal to text. Pavel 2010/3/24 王志刚 <wangzhigan...@gmail.com>: > ??? 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 > > > ------------ > > about the comma after ?1. is a mistake when i paste code into mail. I > simplify some code, so miss the comma. > and i'm sure there is a record with the ID bind for the third parameter. > and the cast pDB,it's no matter.our interface declear is as void*. > -- > Thanks! > 王志刚 > --------------------------- > 电话:021-62672000-2852 > 上海圣诺网络技术有限公司 > --------------------------- > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users