I am developing a site that searches for business by state having a similar issue, here is the code that I have in the search results page-
<%@LANGUAGE="JavaScript"%>
<!--#include virtual="/Connections/avdsmmber.asp" -->
<%
var states_cmd = Server.CreateObject ("ADODB.Command");

states_cmd.ActiveConnection = MM_avdsmmber_STRING;
states_cmd.CommandText = "SELECT businessname, business_address, businesscity, businessstate, businesszip, businesscountry, businessphone, businessfax, website, email FROM Results ORDER BY businessstate ASC";
states_cmd.Prepared = true;

var states = states_cmd.Execute();
var states_numRows = 0;
%>
<%
var Repeat1__numRows = -1;
var Repeat1__index = 0;
states_numRows += Repeat1__numRows;
%>

here is the error I get -
Microsoft JScript compilation error '800a03ec'

Expected ';'

/TMP7gglz7tv3j.asp, line 475

Set statesearch = Nothing
----^