请教一个关于asp与mysql的问题!
请问mysql不支持rs.addnew或者是rs.update吗?
sqltest="select * from new_result where username ='" & username & "' and test_code=" & exam_pa_id & ""
set rstest=server.createobject("adodb.recordset")
rstest.open sqltest,Conn,1,3
if not(rstest.bof and rstest.eof) then
response.Write("<br><li>数据冲突</li>")
else
rstest.addnew
rstest("username")=username
rstest("test_code")=exam_pa_id
rstest("f_status")="N"
rstest("f_date")=date()
rstest("result")=result
rstest("choice")=choice
rstest.update
end if
我使用上面的代码对mysql数据库操作的时候提示我:
[
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC 驱动程序管理器] 无效的字符串或缓冲区长度
]
但我使用:
Conn.Execute("insert into new_result (username,test_code,f_status,f_date,result,choice) values ('"&username&"',"&cint(exam_pa_id)&",'N','"&date()&"','"&result&"','"&choice&"')")
的时候就没有错误,请问是什么原因呢??
(PS:这个问题在我使用update更新数据库已有数据的时候也同样存在)