I have a form on a standard htm page which posts the information to the asp add record page. The code to add the record is as follows:
<%
'open the database using a DSN-less connection
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=C:\Documents and Settings\csbexec\My Documents" & _
"\Intranet\Databases\Worklist.mdb"
Dim objRS
'Set objRS = Server.CreateObject("ADODB.Recordset"
objRS.Open "Worklist", objConn, , adLockOptimistic, adCmdTable
objRS.AddNew
objRS("Name"
= Request.Form("Name"
objRS("Event"
= Request.Form("Event"
objRS("DateStart"
= Request.Form("DateStart"
objRS("DateFinish"
= Request.Form("DateFinish"
objRS("TimeStart"
= Request.Form("TimeStart"
objRS("TimeFinish"
= Request.Form("TimeFinish"
objRS("Description"
= Request.Form("Description"
objRS.Update
objRS.Close
Set objConn = Nothing
%>
Could somebody please suggest an answe to why I get the error message:
Error Type:
ADODB.Recordset (0x800A0E7D)
Operation is not allowed on an object referencing a closed or invalid connection.
It points to the line:
objRS.Open "Worklist", objConn, , adLockOptimistic, adCmdTable
Many thanks...
<%
'open the database using a DSN-less connection
Set objConn = Server.CreateObject("ADODB.Connection"

objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=C:\Documents and Settings\csbexec\My Documents" & _
"\Intranet\Databases\Worklist.mdb"
Dim objRS
'Set objRS = Server.CreateObject("ADODB.Recordset"

objRS.Open "Worklist", objConn, , adLockOptimistic, adCmdTable
objRS.AddNew
objRS("Name"


objRS("Event"


objRS("DateStart"


objRS("DateFinish"


objRS("TimeStart"


objRS("TimeFinish"


objRS("Description"


objRS.Update
objRS.Close
Set objConn = Nothing
%>
Could somebody please suggest an answe to why I get the error message:
Error Type:
ADODB.Recordset (0x800A0E7D)
Operation is not allowed on an object referencing a closed or invalid connection.
It points to the line:
objRS.Open "Worklist", objConn, , adLockOptimistic, adCmdTable
Many thanks...