Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-30-2006, 06:29 PM   PM User | #1
esthera
Senior Coder

 
Join Date: May 2004
Posts: 1,431
Thanks: 14
Thanked 0 Times in 0 Posts
esthera can only hope to improve
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?
esthera is offline   Reply With Quote
Old 12-30-2006, 08:27 PM   PM User | #2
mehere
Regular Coder

 
Join Date: Jan 2005
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
mehere is an unknown quantity at this point
you're going to need to post your code along with indicating which line is causing the error.
mehere is offline   Reply With Quote
Old 12-30-2006, 08:34 PM   PM User | #3
esthera
Senior Coder

 
Join Date: May 2004
Posts: 1,431
Thanks: 14
Thanked 0 Times in 0 Posts
esthera can only hope to improve
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
esthera is offline   Reply With Quote
Old 12-31-2006, 11:43 AM   PM User | #4
bostjank
Regular Coder

 
Join Date: Jul 2002
Location: The sunny side of the Alps
Posts: 230
Thanks: 0
Thanked 0 Times in 0 Posts
bostjank is an unknown quantity at this point
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.
bostjank is offline   Reply With Quote
Old 01-01-2007, 07:06 AM   PM User | #5
esthera
Senior Coder

 
Join Date: May 2004
Posts: 1,431
Thanks: 14
Thanked 0 Times in 0 Posts
esthera can only hope to improve
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.
esthera is offline   Reply With Quote
Old 01-01-2007, 11:52 AM   PM User | #6
bostjank
Regular Coder

 
Join Date: Jul 2002
Location: The sunny side of the Alps
Posts: 230
Thanks: 0
Thanked 0 Times in 0 Posts
bostjank is an unknown quantity at this point
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
bostjank is offline   Reply With Quote
Old 01-01-2007, 05:44 PM   PM User | #7
mehere
Regular Coder

 
Join Date: Jan 2005
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
mehere is an unknown quantity at this point
what is your connection string?
mehere is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:34 AM.


Advertisement
Log in to turn off these ads.