Connection error: ADODB.Recordset (0x800A0E7D)

Discussion in 'ASP General' started by Tom Petersen, Sep 16, 2003.

  1. Tom Petersen

    Tom Petersen Guest

    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!
     
    Tom Petersen, Sep 16, 2003
    #1
    1. Advertising

  2. Tom Petersen

    Ray at Guest

    It appears you never opened your ADODB connection.

    Ray at work

    "Tom Petersen" <> wrote in message
    news:...
    > 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.


    > objRS.Open strSQL, objConn, adOpenKeyset, adLockOptimistic, adCmdText
     
    Ray at, Sep 16, 2003
    #2
    1. Advertising

  3. Tom Petersen

    Tom Petersen Guest

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

    Thanks again!

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:#...
    > It appears you never opened your ADODB connection.
    >
    > Ray at work
    >
    > "Tom Petersen" <> wrote in message
    > news:...
    > > 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.

    >
    > > objRS.Open strSQL, objConn, adOpenKeyset, adLockOptimistic, adCmdText

    >
    >
     
    Tom Petersen, Sep 16, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    3,862
    Ray Costanzo [MVP]
    Sep 22, 2005
  2. Chuck
    Replies:
    1
    Views:
    124
    Ray at
    Oct 21, 2003
  3. middletree

    0x800A0E7D error--don't get it

    middletree, Jan 7, 2004, in forum: ASP General
    Replies:
    8
    Views:
    272
    middletree
    Jan 8, 2004
  4. Drew
    Replies:
    8
    Views:
    272
    Jeff Dillon
    Nov 5, 2004
  5. ching
    Replies:
    3
    Views:
    284
    Bob Barrows [MVP]
    Sep 22, 2005
Loading...

Share This Page