When I first open my ASP page, I get the error "Operation is not allowed when
the object is closed" for a page containing a result set from a database.
Once I submit a query however from the form on the page, it executes and shows
the result set.

Can I force the page to run with initial parameters so I don't get this
unsightly message when the page first opens ?

I have other pages that don't do this, but appear similar in code ???

my email is [email]ian@acecur.demon.co.uk[/email]

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/ME.asp" -->
<%
Dim RSAll__CountryID
RSAll__CountryID = "1"
If (cint(request.querystring("CountryID")) <> "") Then
RSAll__CountryID = cint(request.querystring("CountryID"))
End If
%>
<%
Dim RSAll__MinPrice
RSAll__MinPrice = "15000"
If (clng(request.querystring("MinPrice")) <> "") Then
RSAll__MinPrice = clng(request.querystring("MinPrice"))
End If
%>
<%
Dim RSAll__MaxPrice
RSAll__MaxPrice = "10000000"
If (clng(request.querystring("MaxPrice")) <> "") Then
RSAll__MaxPrice = clng(request.querystring("MaxPrice"))
End If
%>
<%
Dim RSAll__NoBeds
RSAll__NoBeds = "1"
If (cint(request.querystring("NoBeds")) <> "") Then
RSAll__NoBeds = cint(request.querystring("NoBeds"))
End If
%>
<%
Dim RSAll__ResaleOrNot
RSAll__ResaleOrNot = "ANY"
If (cstr(request.querystring("ResaleOrNot")) <> "") Then
RSAll__ResaleOrNot = cstr(request.querystring("ResaleOrNot"))
End If
%>
<%
Dim RSAll
Dim RSAll_numRows

Set RSAll = Server.CreateObject("ADODB.Recordset")
RSAll.ActiveConnection = MM_ME_STRING
RSAll.Source = "{call dbo129583315.AllPropertiesMAIN(" +
Replace(RSAll__CountryID, "'", "''") + "," + Replace(RSAll__MinPrice, "'",
"''") + "," + Replace(RSAll__MaxPrice, "'", "''") + "," +
Replace(RSAll__NoBeds, "'", "''") + ",'" + Replace(RSAll__ResaleOrNot, "'",
"''") + "')}"
RSAll.CursorType = 0
RSAll.CursorLocation = 2
RSAll.LockType = 1
RSAll.Open()

RSAll_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 10
Repeat1__index = 0
RSAll_numRows = RSAll_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<table width="764" border="1" align="center">
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td width="272" height="135"><form id="query" name="query" method="get"
action="Untitled-1.asp">
<p>
<input name="CountryID" type="text" id="CountryID" value="1" />
</p>
<p>
<input name="MinPrice" type="text" id="MinPrice" value="15000" />
</p>
<p>
<input name="MaxPrice" type="text" id="MaxPrice" value="10000000" />
</p>
<p>
<input name="NoBeds" type="text" id="NoBeds" value="1" />
</p>
<p>
<input name="ResaleOrNot" type="text" id="ResaleOrNot" value="ANY" />
</p>
<p>
<input type="submit" name="Submit" value="Submit" />
</p>
</form>
</td>
<td width="476"><%
While ((Repeat1__numRows <> 0) AND (NOT RSAll.EOF))
%>
<table width="764" border="1">
<tr>
<td rowspan="7">&nbsp;</td>
<td>&nbsp;</td>
<td><%=(RSAll.Fields.Item("PropertyName").Value)%> </td>
</tr>
<tr>
<td>&nbsp;</td>
<td><%=(RSAll.Fields.Item("PricePounds").Value)% ></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><%=(RSAll.Fields.Item("CountryName").Value)% ></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><%=(RSAll.Fields.Item("PropertyType").Value)%> </td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
RSAll.MoveNext()
Wend
%></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
</table>
</body>
</html>
<%
RSAll.Close()
Set RSAll = Nothing
%>