|
Joe Kauffman -> RE: Requesting more than one search (11/22/2004 13:03:54)
|
rdouglass, I inserted the code you suggested and I'm now pulling every record in the database. Here is the code. Could it maybe be in the response.write portion? I'm wanting to display the records with a hyperlink for them to click on. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/ds.asp" -->
<% If Session("dsuser") = TRUE Then %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Hacienda Builders - Design Studio Search Results</title>
<style type="text/css">
<!--
body {
background-image: url(images/back.jpg);
}
.style7 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 14px;
}
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>
<body>
<table width="706" border="0" align="center">
<tr>
<td width="700"><div align="center"><img src="images/DSbanner2.gif" width="700" height="80"></div></td>
</tr>
</table>
<p>
<% Set objRS = Server.CreateObject("ADODB.Recordset")
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = MM_DS_STRING
objConn.Open
If Request.QueryString("lastname") <> "" Then
lastname = Request.QueryString("lastname")
Else
lastname = Request.Form("lastname")
End If
If Request.QueryString("community") <> "" Then
community = Request.QueryString("community")
Else
community = Request.Form("address")
End If
If Request.QueryString("lotnumber") <> "" Then
lotnumber = Request.QueryString("lotnumber")
Else
lotnumber = Request.Form("lotnumber")
End If
myCriteria = ""
IF trim(lastname)&"">"" THEN
myCriteria = " WHERE (lastname LIKE '%" & lastname & "%')"
END IF
IF trim(community)&"">"" THEN
IF myCriteria > "" THEN
myCriteria = myCriteria & " AND"
ELSE
myCriteria = myCriteria & " WHERE"
END IF
myCriteria = myCriteria & " (address LIKE '%" & address & "%')"
END IF
'continue with as many fields as you need
IF trim(lotnumber)&"">"" THEN
IF myCriteria > "" THEN
myCriteria = myCriteria & " AND"
ELSE
myCriteria = myCriteria & " WHERE"
END IF
myCriteria = myCriteria & " (address LIKE '%" & address & "%')"
END IF
strSQL = "SELECT tblBuyerLN, tblSub, tblLotNo, ID FROM tblWorkOrder" & myCriteria
Set objRS = objConn.Execute(strSQL)
If NOT objRS.EOF Then
End IF
%>
<table width="100%" border="0">
<tr>
<td><div align="center">Click on the desired buyer below to edit their Work Order. </div></td>
</tr>
</table>
<table border="0" width="100%" id="table1">
<tr>
<td>
<table width="53%" border="2" align="center" bordercolorlight="#672C74" bordercolordark="#672C74" id="table2">
<tr>
<td width="33%" align="center" style="font-family: Verdana, Arial, Helvetica, sans-serif">Choose One </td>
<td width="22%" align="left" style="font-family: Verdana, Arial, Helvetica, sans-serif">Name </td>
<td width="22%" align="center" style="font-family: Verdana, Arial, Helvetica, sans-serif">Subdivision</td>
<td width="11%" align="center" style="font-family: Verdana, Arial, Helvetica, sans-serif">Lot</td>
<td width="12%" align="center" style="font-family: Verdana, Arial, Helvetica, sans-serif">ID</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<form action="dsupdaterecord.asp" method="post" name="lastname">
</table>
<table width="53%" border="2" align="center" bordercolorlight="#672C74" bordercolordark="#672C74" id="table3">
<%
Dim i
FOR i = 0 to objRS.Fields.Count - 1
%>
<% next %>
<%
y=1
While Not objRS.EOF
if y MOD 2 = 0 Then
response.write "<tr style='background-color:cornsilk;'>"
Else
response.write "<tr style='background-color:white;'>"
End If
y=y+1
%>
<td align="center" style="font-family: Verdana, Arial, Helvetica, sans-serif"><div align="center">
<% For i = 0 to objRS.Fields.Count - 1 %>
<%
If i=0 Then
response.write "<a href=""dsupdateworkorder.asp?ID="&objRS("ID")&""">Click to Edit</a><td>"
response.write objRS("tblBuyerLN")
ElseIf IsNull(objRS(i)) Then
Response.Write " "
Else
Response.Write objRS(i).Value
End If%>
</div></td>
<td align="center" style="font-family: Verdana, Arial, Helvetica, sans-serif">
<div align="center">
<% Next %>
<% objRS.MoveNext
Wend
%>
</table>
<p align="center"> </p>
</form>
</td>
</tr>
<p> </td>
</tr>
</table>
<%
Else
Response.Write "You are not authorized to view this page."
response.write "<a href='dsloginpage.asp'>Click here to Login.</A>"
End IF
%> Thanks again for your help. Joe
|
|
|
|