我有这个密码:
Set oConnection = Server.CreateObject("ADODB.Connection")
Set oRecordset = Server.CreateObject("ADODB.Recordset")
oConnection.Open "DRIVER={MySQL ODBC 5.1 Driver};SERVER=localhost;UID=xxxx;PWD=xxxx;DATABASE=xxxx; OPTION=3;"
Sqltemp = "INSERT INTO rsvptable (fname, lname, fbid, rsvp, streetaddress, city, state, zip, streetaddress2, cellphone, acode) " & _
"VALUES ('" & firstName & "', '" & lastName & "', " & fb & ", 0, '" & address1 & "', '" & city & "', '" & strState & "', " & zip & ", '" & address2 & "', " & cell & ", " & returnedNums & ")"
set newAdd = oConnection.execute(Sqltemp)
if newAdd.EOF then
response.write "end"
else
response.write "not end"
end if
它一直告诉我:
ADODB.记录集错误“800a0e78”
对象关闭时不允许操作。
/add.asp,第136行
第136行是:
if newAdd.EOF then
我在这里可以俯瞰什么?
更新
找到我的答案了!:o)
How to tell if a db update was successful?
最佳答案
两件事:
将oRecordset
定义为记录集,但在newAdd
上使用&check eof
为什么要从插入查询填充记录集?