...

View Full Version : asp and sql server express



esthera
12-30-2006, 06: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.

please advise?

mehere
12-30-2006, 08:27 PM
you're going to need to post your code along with indicating which line is causing the error.

esthera
12-30-2006, 08:34 PM
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

bostjank
12-31-2006, 11:43 AM
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.

esthera
01-01-2007, 07: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.

bostjank
01-01-2007, 11:52 AM
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

mehere
01-01-2007, 05:44 PM
what is your connection string?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum