SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Sep 2010
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why I get ADODB.Recordset error '800a0e78'

    I have a query that is tested, and I am trying to get the data by executing it.
    The connection is tested and working for other queries on the same page.
    Yet - when trying to execute it - I get "ADODB.Recordset error '800a0e78'
    Operation is not allowed when the object is closed."

    I searched for this error and did not find any solution.
    The only thing I want to mention here is - in the query, I have some variable declaration, then a temp table declaration and insertion in that. And finally the main query. Having multiple statements should not be a problem, should it?

    Thanks.

  2. #2
    SitePoint Addict
    Join Date
    Apr 2009
    Posts
    356
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    One guess, if you have any 'on error resume next' statement try removing it. When on error resume next is active it will hide asp error messages, perhaps you have some other coding error that is preventing your recordset object from opening.
    Doug G
    =====
    "If you ain't the lead dog, the view is always the same - Anon

  3. #3
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    675
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    we can't really help unless you post the problem code.

    but it is likely just what the error message says: closed object. Make sure you open the recordset object before trying to use it.

    Code ASP:
        Dim oConn, oRs: 
        Set oConn =  CreateObject("ADODB.Connection")    
        Set oRs = CreateObject("ADODB.Recordset")
     
        '// OPEN THE CONNECTION OBJECT
        '-----------------------------------------
        With oConn
            If .State = adStateOpen Then .Close
            .ConnectionString = MY_CONNECTION_STRING
            .open
        End With

  4. #4
    SitePoint Member
    Join Date
    Sep 2010
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Doug and Webber. I removed the variable declaration, the temp table insertion etc. that was there before the main select, instead - using the parameters directly in the select. Then it started working.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •