View Full Version : asp and sql server express
12-30-2006, 07:29 PM
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.
12-30-2006, 09:27 PM
you're going to need to post your code along with indicating which line is causing the error.
12-30-2006, 09:34 PM
Set RS = server.CreateObject("adodb.recordset")
.Open strSQL '& " order by " & replace(strSort,"desc"," desc"), objConn,3 '3 is adOpenStatic
.PageSize = cint(intPageSize)
intTotalPages = .PageCount
intCurrentRecord = .AbsolutePosition
.AbsolutePage = intCurrentPage
intTotalRecords = .RecordCount
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
12-31-2006, 12:43 PM
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/8000xxxxx-errors/why-do-i-get-800a0e7d-errors.html for more information.
01-01-2007, 08:06 AM
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.
01-01-2007, 12:52 PM
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:
Set objconn = Nothing
01-01-2007, 06:44 PM
what is your connection string?
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.