Error: Operation is not allowed when the object is closed.
I am getting the following error:
Line 83 is this: However, as far as I can see, what I am trying to do (add records) takes place while the connection is open. Here is the relevant code:
ADODB.Recordset error '800a0e78'
Operation is not allowed when the object is closed.
/display_records3.asp, line 83
Does the error occur because I ask for
Dim conn, rs, sSQL, sConnString, my_firstName, my_lastName, my_wolfID, my_telNo, my_stAddress, my_city, my_postCode, my_items, my_received, my_dispatched
sSQL="INSERT INTO tblWolf " _
& "(firstName, lastName, wolfID, telNo, stAddress, city, postCode, items, received, dispatched)" _
& " VALUES ('" & my_firstName & "', '" & my_lastName & "'," & my_wolfID & ", " _
& my_telNo & ", '" & my_stAddress & "', '" & my_city & "', '" & my_postCode & "'," _
& " '" & my_items & "', #" & my_received & "#, #" & my_dispatched & "#)"
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("myDatabase.mdb")
'Determine whether there are any records
If rs.EOF Then
Response.Write "<tr><td>No records returned.</td></tr>"
'Loop through the fields and format
Do While Not rs.EOF
'Close HTML table
Set rs = Nothing
Set conn = Nothing
BEFORE I open the database?
="INSERT INTO tblWolf "