Connection error: ADODB.Recordset (0x800A0E7D)

T

Tom Petersen

I have been copying and pasting code and this has been working, but now I
get this error:
Error Type:
ADODB.Recordset (0x800A0E7D)
Operation is not allowed on an object referencing a closed or invalid
connection.
/forms/maintreqresults1.asp, line 26.

I'm sure I'm missing something simple, but I am at a loss with this. The
code is below, the URL string appears to be valid:
http://sd-school/forms/maintreqresults1.asp?action=edit&id=700


<!-- #include file="../adovbs.inc" -->
<%
server.execute "../header.htm"

DIM objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
strConn= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\main\maint.mdb"

strAction = request.querystring("action")
strID = request.querystring("id")


Select Case strAction

Case "edit"

If IsNumeric(strID) Then
strID = CLng(strID)
Else
strID = 0
End If

Set objRS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM service WHERE id=" & strID & ";"
objRS.Open strSQL, objConn, adOpenKeyset, adLockOptimistic, adCmdText
<-line 26

objRS.MoveFirst

objRS("dcomp") = Request.Form("dcomp")
objRS("time") = Request.Form("time")
objRS("reason") = Request.Form("reason")
objRS("action") = Request.Form("action")
objRS("who") = Request.Form("who")

objRS.Update


objRS.Close
Set objRS = Nothing


End Select
%>

Thanks again for all of the help!
 
T

Tom Petersen

Doh, thanks, that was it. Did I mention that web design isn't my primary
job function? :)

Thanks again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top