Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Could this be a Connection problem? 1

Status
Not open for further replies.

roblasch

Programmer
Dec 30, 2000
168
US
The following code causes this message:ADODB.Recordset error '800a0e78'
Operation is not allowed when the object is closed.
This page works fine on my computer and on anohter server. But it won't work on the server that I need it to. The differences are sql7 instead of 2000 and winNT4 instead of 2000. Should either of these be causing it? I am baffled.

Set objCommand= Server.CreateObject("ADODB.Command")
objCommand.ActiveConnection=strConnect

strSQL="SELECT * from tblEvents where (Active=0 or Active=1) and datepart(month,startdate)=" & getMonth & " ORDER by startDate,Town" ' datepart(month,getdate() )"
strSQL="Exec spPagedItems " & page & "," & numToGet & ",'" & strSQL & "'"


objCommand.CommandText=strSQL
Set objRS= objCommand.Execute

if not objRS.EOF then
if objRS("MoreRecords")>0 then
Response.Write &quot;<input type='hidden' value='&quot; & page+1 & &quot;' />&quot;
Response.Write &quot; <input type='submit' value='Next page' name='Next' />&quot;
end if
End If
 
My guess is that you are using sql2000 specific query functions. I haven't used sql server at all ( I use MySQL ), so I can't be too sure... but I don't think that NT would make a difference, and you are using a lot of sql db specific stuff in your query. I would check there.

Which line of code is causing the error message? Brett Birkett B.Comp
Systems Analyst
 
Thanks for your help! It actually was a very stupid thing that I did. I didn't copy all of the stored procedure when I cut and pasted it. So it was missing some important lines. But I found it when I was following the path of attack that you laid down for me. In retrospect it was the kind of thing that could have gone unoticed for a long time while I barked up the wrong tree. So thank you very much. I feel much better now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top