I have written this to the best of my knowledge but can't get it to run with the (Request.QueryString("menuPrice_range" & Request.QueryString("menuPrice_range1"is utilized. This is my results page for a MS Access database query. For some of you guys this will probably be a no brainer. Thanks for your time!!
<%
Dim tfm_orderby, tfm_order
tfm_orderby = "sold_price"
tfm_order = "ASC"
If(CStr(Request.QueryString("tfm_orderby") <> "" Then
tfm_orderby = Cstr(Request.QueryString("tfm_orderby")
End If
If(Cstr(Request.QueryString("tfm_order") <> "" Then
tfm_order = Cstr(Request.QueryString("tfm_order")
End If
Dim sql_orderby
sql_orderby = " " & tfm_orderby & " " & tfm_order
%>
<%
Dim rsResults__varCategory
rsResults__varCategory = "%"
if (Request.QueryString("menuCategory" <> "" then rsResults__varCategory = Request.QueryString("menuCategory"
%>
<%
Dim rsResults__varCounty
rsResults__varCounty = "%"
if (Request.QueryString("menuCounty" <> "" then rsResults__varCounty = Request.QueryString("menuCounty"
%>
<%
Dim rsResults__varFoundation
rsResults__varFoundation = "%"
if (Request.QueryString("menuFoundation" <> "" then rsResults__varFoundation = Request.QueryString("menuFoundation"
%>
<%
Dim rsResults__sql_orderby
rsResults__sql_orderby = "sold_price"
if (sql_orderby <> "" then rsResults__sql_orderby = sql_orderby
%>
<%
Dim rsResults__varPrice_range
rsResults__varPrice_range >= "%"
if (Request.QueryString("menuPrice_range" <> "" then rsResults__varPrice_range = Request.QueryString("menuPrice_range"
%>
<%
Dim rsResults__varPrice_range1
rsResults__varPrice_range1 <= "%"
if (Request.QueryString("menuPrice_range1" <> "" then rsResults__varPrice_range1 = Request.QueryString("menuPrice_range1"
%>
<%
Dim rsResults__varKeywords
rsResults__varKeywords = "%"
if (Request.QueryString("menuKeywords" <> "" then rsResults__varKeywords = Request.QueryString("menuKeywords"
%>
<%
set rsResults = Server.CreateObject("ADODB.Recordset"
rsResults.ActiveConnection = MM_connBusDirectory_STRING
rsResults.Source = "SELECT * FROM businesses WHERE approved = 'Yes' AND sold_price like '" + Replace(rsResults__varPrice_range, "'", "''" + "' AND sold_price like '" + Replace(rsResults__varPrice_range1, "'", "''" + "' AND category like '" + Replace(rsResults__varCategory, "'", "''" + "' AND county like '" + Replace(rsResults__varCounty, "'", "''" + "' AND foundation like '" + Replace(rsResults__varFoundation, "'", "''" + "' AND Address_1 like '%" + Replace(rsResults__varKeywords, "'", "''" + "%' OR approved = 'Yes' AND sold_price like '" + Replace(rsResults__varPrice_range, "'", "''" + "' AND sold_price like '" + Replace(rsResults__varPrice_range1, "'", "''" + "' AND category like '" + Replace(rsResults__varCategory, "'", "''" + "' AND county like '" + Replace(rsResults__varCounty, "'", "''" + "' AND foundation like '" + Replace(rsResults__varFoundation, "'", "''" + "' AND desc_short like '%" + Replace(rsResults__varKeywords, "'", "''" + "%' OR approved = 'Yes' AND sold_price like '" + Replace(rsResults__varPrice_range, "'", "''" + "' AND sold_price like '" + Replace(rsResults__varPrice_range1, "'", "''" + "' AND category like '" + Replace(rsResults__varCategory, "'", "''" + "' AND county like '" + Replace(rsResults__varCounty, "'", "''" + "' AND foundation like '" + Replace(rsResults__varFoundation, "'", "''" + "' AND busname like '%" + Replace(rsResults__varKeywords, "'", "''" + "%' ORDER BY " + Replace(rsResults__sql_orderby, "'", "''" + ""
rsResults.CursorType = 0
rsResults.CursorLocation = 2
rsResults.LockType = 3
rsResults.Open()
rsResults_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
rsResults_numRows = rsResults_numRows + Repeat1__numRows
%>
<%
Dim tfm_orderby, tfm_order
tfm_orderby = "sold_price"
tfm_order = "ASC"
If(CStr(Request.QueryString("tfm_orderby") <> "" Then
tfm_orderby = Cstr(Request.QueryString("tfm_orderby")
End If
If(Cstr(Request.QueryString("tfm_order") <> "" Then
tfm_order = Cstr(Request.QueryString("tfm_order")
End If
Dim sql_orderby
sql_orderby = " " & tfm_orderby & " " & tfm_order
%>
<%
Dim rsResults__varCategory
rsResults__varCategory = "%"
if (Request.QueryString("menuCategory" <> "" then rsResults__varCategory = Request.QueryString("menuCategory"
%>
<%
Dim rsResults__varCounty
rsResults__varCounty = "%"
if (Request.QueryString("menuCounty" <> "" then rsResults__varCounty = Request.QueryString("menuCounty"
%>
<%
Dim rsResults__varFoundation
rsResults__varFoundation = "%"
if (Request.QueryString("menuFoundation" <> "" then rsResults__varFoundation = Request.QueryString("menuFoundation"
%>
<%
Dim rsResults__sql_orderby
rsResults__sql_orderby = "sold_price"
if (sql_orderby <> "" then rsResults__sql_orderby = sql_orderby
%>
<%
Dim rsResults__varPrice_range
rsResults__varPrice_range >= "%"
if (Request.QueryString("menuPrice_range" <> "" then rsResults__varPrice_range = Request.QueryString("menuPrice_range"
%>
<%
Dim rsResults__varPrice_range1
rsResults__varPrice_range1 <= "%"
if (Request.QueryString("menuPrice_range1" <> "" then rsResults__varPrice_range1 = Request.QueryString("menuPrice_range1"
%>
<%
Dim rsResults__varKeywords
rsResults__varKeywords = "%"
if (Request.QueryString("menuKeywords" <> "" then rsResults__varKeywords = Request.QueryString("menuKeywords"
%>
<%
set rsResults = Server.CreateObject("ADODB.Recordset"
rsResults.ActiveConnection = MM_connBusDirectory_STRING
rsResults.Source = "SELECT * FROM businesses WHERE approved = 'Yes' AND sold_price like '" + Replace(rsResults__varPrice_range, "'", "''" + "' AND sold_price like '" + Replace(rsResults__varPrice_range1, "'", "''" + "' AND category like '" + Replace(rsResults__varCategory, "'", "''" + "' AND county like '" + Replace(rsResults__varCounty, "'", "''" + "' AND foundation like '" + Replace(rsResults__varFoundation, "'", "''" + "' AND Address_1 like '%" + Replace(rsResults__varKeywords, "'", "''" + "%' OR approved = 'Yes' AND sold_price like '" + Replace(rsResults__varPrice_range, "'", "''" + "' AND sold_price like '" + Replace(rsResults__varPrice_range1, "'", "''" + "' AND category like '" + Replace(rsResults__varCategory, "'", "''" + "' AND county like '" + Replace(rsResults__varCounty, "'", "''" + "' AND foundation like '" + Replace(rsResults__varFoundation, "'", "''" + "' AND desc_short like '%" + Replace(rsResults__varKeywords, "'", "''" + "%' OR approved = 'Yes' AND sold_price like '" + Replace(rsResults__varPrice_range, "'", "''" + "' AND sold_price like '" + Replace(rsResults__varPrice_range1, "'", "''" + "' AND category like '" + Replace(rsResults__varCategory, "'", "''" + "' AND county like '" + Replace(rsResults__varCounty, "'", "''" + "' AND foundation like '" + Replace(rsResults__varFoundation, "'", "''" + "' AND busname like '%" + Replace(rsResults__varKeywords, "'", "''" + "%' ORDER BY " + Replace(rsResults__sql_orderby, "'", "''" + ""
rsResults.CursorType = 0
rsResults.CursorLocation = 2
rsResults.LockType = 3
rsResults.Open()
rsResults_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
rsResults_numRows = rsResults_numRows + Repeat1__numRows
%>