VBScript 發生錯誤:錯誤號碼:3704錯誤說明:當物件關閉時,不允許操作。錯誤輔助說明:1240653錯誤來源:Microsoft VBScript 執行階段錯誤
why?
source code
------------------------------------------------------------------------------------------
<html>
<body>
<!--#include file="databaseFunctions.asp"-->
<%On Error Resume Next 'Dim strStockID,strMemberID,strPrice,strOrder_num,strOrder_name,strOrder_tel,strReceive_name,strReceive_tel,strReceive_address,strPayment,strDatestrorder_name = Request.Form("order_name")
strorder_tel = Request.Form("order_tel")
strReceive_name = Request.Form("receive_name")
strReceive_tel = Request.Form("receive_tel")Set objRS = Server.CreateObject("ADODB.RecordSet")
sql = "select * from order"
objRS.Open sql,objDBConn,1 ,3objRS.AddNew
objRS.Fields("stockID") = session("StockID")
objRS.Fields("loginID") = session("LoginID")
objRS.Fields("sprice") = session("Price")
objRS.Fields("order_num") = session("order_num")
objRS.Fields("order_name") = strorder_name
objRS.Fields("order_tel") = strorder_tel
objRS.Fields("receive_name") = strReceive_name
objRS.Fields("receive_tel") = strReceive_tel
objRS.Update
If Err.Number > 0 Then
Response.Write "VBScript 發生錯誤:" & "<P>"
Response.Write "錯誤號碼:" & Err.Number & "<P>"
Response.Write "錯誤說明:" & Err.Description & "<P>"
Response.Write "錯誤輔助說明:" & Err.Helpcontext & "<P>"
Response.Write "輔助說明路徑" & Err.Helppath & "<P>"
Response.Write "原始錯誤:" & Err.Nativeerror & "<P>"
Response.Write "錯誤來源:" & Err.Source & "<P>"
Response.Write "SQL語法:" & Err.Sqlstate & "<P>"
End If
If objDBConn.Errors.Count > 0 Then
Response.Write "資料庫發生錯誤"&"<p>"
For intCounter = 0 to objDBConn.Errors.Count
Response.write.write "錯誤碼:"&_
objDBConn.Errors(intCounter).Number & "<P>"
Response.write "錯誤說明:"&_
objDBConn.Errors(intCounter).Description & "<p>"
Next.......%>