Formulario de búsqueda que devuelva todos los registros
Hola a todos, estoy en la recta final de mi página y tengo un problema.
Estoy utilizando Dreamweaver CS3 y ASP VBScript
Se trata de búsqueda y resultado:
Tengo un formulario con un list/menu con 3 opciones:
All: Valor "All"
New Property: valor New Property
Resale Property: Valor Resale Property
- Si selecciono "New Property" la pagina de resultados me devuelve un listado con los registros que coinciden con "New Property"
- Con la opción "Resale Property" devuelve un listado de registros que coinciden con "Resale Properties"
- La cuestión es que necesito que al seleccionar la opción "All" la pagina de resultados me devuelva un listado de todos los registros ya sean "New Property" o "Resale Property"
El código del formulario
<form id="form1" name="form1" method="post" action="2.asp">
<table width="268">
<tr>
<td><div align="right">New or Resale:</div></td>
<td><label>
<select name="New_resale" id="New_resale">
<option value="*">All</option>
<option value="New Property">New Property</option>
<option value="Resale Property">Resale Property</option>
</select>
</label></td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="submit" name="Search" id="Search" value="Search" />
</label></td>
</tr>
</table>
</form>
-------------------------------------
Y el código de la pagina de resultados
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/amanda.asp" -->
<%
Dim Property_type__varNew_resale
Property_type__varNew_resale = "%"
If (Request.Form("New_resale") <> "") Then
Property_type__varNew_resale = Request.Form("New_resale")
End If
%>
<%
Dim Property_type__varNew_resale
Property_type__varNew_resale = "*"
Property_type__varNew_resale = Request.Form("New_resale")
%>
<%
Dim Property_type
Dim Property_type_cmd
Dim Property_type_numRows
Set Property_type_cmd = Server.CreateObject ("ADODB.Command")
Property_type_cmd.ActiveConnection = MM_amanda_STRING
Property_type_cmd.CommandText = "SELECT * FROM [Resale Properties] WHERE ? = New_resale ORDER BY New_resale ASC"
Property_type_cmd.Prepared = true
Property_type_cmd.Parameters.Append Property_type_cmd.CreateParameter("param1", 200, 1, 255, Property_type__varNew_resale) ' adVarChar
Set Property_type = Property_type_cmd.Execute
Property_type_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Property_type_numRows = Property_type_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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<%
While ((Repeat1__numRows <> 0) AND (NOT Property_type.EOF))
%>
<%=(Property_type.Fields.Item("Type_English").Value)%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Property_type.MoveNext()
Wend
%>
</body>
</html>
<%
Property_type.Close()
Set Property_type = Nothing
%>
Os agradecería que me ayudéis, he mirado en mil sitios en Internet y no he encontrado nada, ayuda por favor.
Gracias