Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Senior Coder
    Join Date
    May 2004
    Posts
    1,466
    Thanks
    15
    Thanked 0 Times in 0 Posts

    asp and sql server express

    I recently moved my access db to sql server express and I am making the neccessary changes in the asp code.

    for some reason when opening my recordset I get an error
    ADODB.Recordset error '800a0e7d'

    The connection cannot be used to perform this operation. It is either closed or invalid in this context.

    if i copy and paste the sql straight to query analyzer it works.
    it is something with teh asp connection and I think particularly when using .CursorLocation=3 which i need for paging.

    please advise?

  • #2
    Regular Coder
    Join Date
    Jan 2005
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you're going to need to post your code along with indicating which line is causing the error.

  • #3
    Senior Coder
    Join Date
    May 2004
    Posts
    1,466
    Thanks
    15
    Thanked 0 Times in 0 Posts
    Set RS = server.CreateObject("adodb.recordset")

    With RS
    .CursorLocation=3
    .Open strSQL '& " order by " & replace(strSort,"desc"," desc"), objConn,3 '3 is adOpenStatic
    .PageSize = cint(intPageSize)
    intTotalPages = .PageCount
    intCurrentRecord = .AbsolutePosition
    .AbsolutePage = intCurrentPage
    intTotalRecords = .RecordCount
    End With

    the line .open is erroring.
    this exact code worked when the db was access but now that i switched to sql express it does not work. if i put the same sql directly in query analyzer it does work but not from asp. other queries do work so it is not the connection

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The most likely cause is that you are trying to set the command object's activeConnection to an invalid connection object.

    See http://tutorials.aspfaq.com/8000xxxx...7d-errors.html for more information.

  • #5
    Senior Coder
    Join Date
    May 2004
    Posts
    1,466
    Thanks
    15
    Thanked 0 Times in 0 Posts
    it works sometimes but sometimes not

    could this be because of the limit of connection to sql express?
    I close the connection at the end of my file doing objconn.close -- is this enough? I am the only one connecting at this time as it is still in test mode.

  • #6
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think that the number of connections in SQL Express is above 1000, so I don't believe that's the problem.
    As far as connection closing is concerned, it is good practice to remove the object from memory when you stop using it:
    Code:
    Set objconn = Nothing

  • #7
    Regular Coder
    Join Date
    Jan 2005
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what is your connection string?


  •  

    Posting Permissions

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