<% Response.Buffer = True %> Classified Ads Search Results <% Dim Connect, RecSet, Query, NoResults, AdsID, City, State, Country, Category, Keyword, ThisDay, Counter, RecStart, Pass 'Create database connection Set Connect = Server.CreateObject("ADODB.Connection") Connect.Open "Indcla3" 'Get the form info into local variables RecStart = Request("RecStart") Category = Trim(Request("Category")) Keyword = Trim(Request("Keyword")) AdsID = Request("AdsID") City = Trim(Request("City")) State = Trim(Request("State")) Country = Trim(Request("Country")) ThisDay = Trim(CStr(Date)) 'Check to see if AdsID was filled in...create query for it...otherwise create Query for other variables If AdsID <> "" Then 'Query = "SELECT * FROM Ads WHERE AdsID=" & AdsID & " AND DateExp >= #" & ThisDay & "#" Query = "SELECT * FROM Unexpired WHERE AdsID=" & AdsID Else Query = "SELECT *, Format(DateMod, 'mm/dd/yy') As DateChanged FROM Unexpired " Query = Query & "WHERE " Query = Query & "(((Category1)LIKE '%%" & Category & "%%') OR ((Category2) LIKE '%%" & Category & "%%') OR ((Category3) LIKE '%%" & Category & "%%')) AND " Query = Query & "(((Keyword1) LIKE '%%" & Keyword & "%%') OR ((Keyword2) LIKE '%%" & Keyword & "%%') OR ((Keyword3) LIKE '%%" & Keyword & "%%') OR ((Keyword4) LIKE '%%" & Keyword & "%%')) AND " Query = Query & "((City) LIKE '%%" & City & "%%') AND ((State) LIKE '%%" & State & "%%') AND ((Country) LIKE '%%" & Country & "%%') " 'Query = Query & " AND ((DateExp) >= #" &ThisDay &"#)" Query = Query & "ORDER BY Cost desc, DateMod desc, Company desc" End If 'response.write query 'Execute the Query and set it to the variable RecSet Set RecSet = Connect.Execute(Query) %>
Search:
Keywords:
In Association with Amazon.com

Ad Search Results

                   Stop by often, new listing added every day!


Please visit our sponsors. Thank you.

<%'Start the listing of ads NoResults = True Counter = 0 If RecStart > 1 Then For Pass = 1 To RecStart RecSet.MoveNext Next End If Do Until RecSet.EOF OR Counter = 10 NoResults = False Counter = Counter + 1 %>
Ad #: <%=RecSet("AdsID")%>
Placed on: <%=RecSet("DateMod")%>

<%'If ad costs money...identify as a premium ad with arrows If RecSet("Cost") <> "0.00" THEN%> Premium Ad! <%End If%>

<%=RecSet("Description")%>

<%'If ad costs money...identify as a premium ad with arrows If RecSet("Cost") <> "0.00" THEN%> Premium Ad! <%End If%>

<%'If ad costs money...create Premium Ad logo on left If RecSet("Cost") > 0 THEN%> P
R
E
M
I
E
R
E

A
D
<%End If%>

URL: "><%=RecSet("URL")%>
Company: <%=RecSet("Company")%>
Contact Person: <%=RecSet("Contact")%>
Phone: <%=RecSet("Phone")%>
Fax: <%=RecSet("Fax")%>
Email: "><%=RecSet("Email")%>
Address: <%=RecSet("Address")%>
City: <%=RecSet("City")%>
State: <%=RecSet("State")%>
Zip Code: <%=RecSet("Zip")%>
Country: <%=RecSet("Country")%>

<%'If ad costs money...create Premium Ad Logo on right If RecSet("Cost") <> "0.00" Then%> P
R
E
M
I
E
R
E

A
D
<%End If%>


<% RecSet.MoveNext Loop%> <%'If ten ads are displayed, then give a choice to see the next ten or the previous ten If Counter = 10 AND NOT(RecSet.EOF) Then RecStart = RecStart + 10 %>

Click here to see the next ten ads

Or click the back button on your browser to see the previous ten ads <%End If%><%If NoResults = True Then%>

No ad listings matched your search criteria.

<%End If%>

Return to the Main Search Page