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.
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
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.
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: