PDA

View Full Version : Object is required error`


BarrMan
11-26-2005, 08:38 PM
<%On Error Resume Next

If Request.QueryString("language") = "" Then
Response.Write "You didn't select a language"
Response.End
End If
Dim anArray(120), anArray2(120), anArray3(120)
For i=1 to 120
anArray(i) = request.form("answer"&i)
anArray2(i) = Request.Form("thona"&i)
anArray3(i) = Request.Form("plusor"&i)
IF anArray(i) = "" Or anArray2(i) = "" Or anArray3(i) = "" then
response.write("<b>You didnt check question number"&i&"</b> <br> <b>לא ענית על שאלה מספר:"&i&"</b>")
response.end
end if
next
Dim thona, answar, plusor
C1=0
C2=0
C3=0
Cr=0
C5=0
For i=1 to 120
answar = anArray(i)
thona = anArray2(i)
plusor = anArray3(i)
next
%>
.....
<%
Dim path, conn, SQL
path = Server.MapPath("db1.mdb")
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "provider=microsoft.jet.oledb.4.0;data source=" &path
SQL = "INSERT INTO results ([user], [resilience], [self-control], [cooperation], [extroversion], [conservatism]) VALUES('" & session("user") & "'," & C1 & "," & C2 & "," & C3 & "," & Cr & "," & C5 & ")"
conn.Execute SQL
Set conn = Nothing
conn.close
If Err.number > 0 then
Response.Write Err.Description
end if
%>

Freon22
11-26-2005, 09:54 PM
Set conn = Nothing
conn.close
If Err.number > 0 then
Response.Write Err.Description
end if
%>
You can't close an object that doesn't exist.

conn.close
Set conn= Nothing

BarrMan
11-27-2005, 05:27 AM
right! thx