結果不允許操作我有這樣的代碼:經典ASP MySQL的INSERT得到當對象被關閉
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.Recordset錯誤「800a0e78」
當對象關閉時不允許操作。
/add.asp,線136
線136是這樣的:
if newAdd.EOF then
什麼,我會在這裏可以俯瞰?
UPDATE
發現我的答案在這裏! :O)
How to tell if a db update was successful?
+1 - 總是很高興看到人們爲自己的問題尋找解決方案 - 並且儘可能使用Command對象 - 如此讚揚 – HeavenCore