Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Operation is not allowed when the object is closed

Reply
Thread Tools

Operation is not allowed when the object is closed

 
 
Mike P
Guest
Posts: n/a
 
      08-07-2008
I keep getting this error whenever I try to run the following code (the
connection string is global and declared at the top of the page) :

<%
Option Explicit
Dim strConnection
%>

<!--#include file="include_connection.asp"-->

dim andList
dim rsSearch
dim rsSQL

set rsSearch = CreateObject("ADODB.Recordset")

'==== select a LOAD ID subset it required
andList = ""

'==== select a companyname subset it required
if (len(Request("name"))>0) then
andList = andList & " AND c.[name] like '%" &
replace(Request("name"),"'","''") & "%' " & vbcrlf
end if

'==== select a contactname subset it required
if Request("contactName") > "" then
andList = andList & " AND co.contactname like '%" &
Request("contactname") & "%' " & vbcrlf
end if

if (andList <> "") then
rsSQL = "exec GetEmailCompanyList @pUserKey = '"&lintUserKey&"' ,
@pAndList = '"&replace(andList,"'","''")&"'"
else
rsSQL = "exec GetEmailCompanyList @pUserKey = '"&lintUserKey&"'"
end if

'==set page size and cursor position
rsSearch.PageSize = 100
rsSearch.CursorLocation = adUseClient

rsSearch.Open rsSQL, strConnection

'If rsSearch.State = adStateOpen then
' response.write rsSQL & " - Open"
' Response.end
'else
' response.write rsSQL & " - Closed"
' Response.end
'end if

if (rsSearch.EOF) then
Response.Write "<P align=center><font size=2 color=000000><B>No
Companies Found"
Response.end
end if

I get the error on the line 'if (rsSearch.EOF) then' and only when I
pass a value for name or contactname.



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
asp to asp.net operation not allowed when object is closed amitbadgi@gmail.com ASP .Net 1 08-10-2005 11:36 AM
"operation is not allowed when the object is closed" error when using VBA online help -- Resolution TC ASP General 1 01-12-2005 09:05 AM
Operation is not allowed when the object is closed. ASP General 1 12-20-2004 04:51 PM
sp_executesql Operation is not allowed when the object is closed cliverama ASP General 1 11-05-2003 01:03 PM
Error "Operation is not allowed when the object is closed" Matthew Louden ASP General 6 09-28-2003 02:26 AM



Advertisments