Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/09/2012, 07:44
elielbeck
 
Fecha de Ingreso: marzo-2008
Mensajes: 228
Antigüedad: 16 años, 8 meses
Puntos: 12
Respuesta: Duda sobre <option value="">

Lo he hecho para todos los campos:

Código:
<%
Dim Search_properties__varNew_resale
Search_properties__varNew_resale = "%"
If (Request.Form("New_resale") <> "") Then 
  Search_properties__varNew_resale = Request.Form("New_resale")
End If
%>
<%
Dim Search_properties__varTown
Search_properties__varTown = "%"
If (Request.Form("Town") <> "") Then 
  Search_properties__varTown = Request.Form("Town")
End If
%>
<%
Dim Search_properties__varType_English
Search_properties__varType_English = "%"
If (Request.Form("Type_English") <> "") Then 
  Search_properties__varType_English = Request.Form("Type_English")
End If
%>
<%
Dim Search_properties__varBedrooms
Search_properties__varBedrooms = "%"
If (Request.Form("Bedrooms") <> "") Then 
  Search_properties__varBedrooms = Request.Form("Bedrooms")
End If
%>
<%
Dim Search_properties__varBathrooms
Search_properties__varBathrooms = "%"
If (Request.Form("Bathrooms") <> "") Then 
  Search_properties__varBathrooms = Request.Form("Bathrooms")
End If
%>
<%
Dim Search_properties__varPrice
Search_properties__varPrice = "1"
If (Request.Form("Price") <> "") Then 
  Search_properties__varPrice = Request.Form("Price")
End If
%>
<%
Dim Search_properties
Dim Search_properties_cmd
Dim Search_properties_numRows

Set Search_properties_cmd = Server.CreateObject ("ADODB.Command")
Search_properties_cmd.ActiveConnection = MM_amanda_STRING
Search_properties_cmd.CommandText = "SELECT * FROM [Resale properties] WHERE ? = New_resale AND ? = Town AND ? = Type_English AND ? = Bedrooms AND ? = Bathrooms AND ? >= Price" 
Search_properties_cmd.Prepared = true
Search_properties_cmd.Parameters.Append Search_properties_cmd.CreateParameter("param1", 200, 1, 255, Search_properties__varNew_resale) ' adVarChar
Search_properties_cmd.Parameters.Append Search_properties_cmd.CreateParameter("param2", 200, 1, 255, Search_properties__varTown) ' adVarChar
Search_properties_cmd.Parameters.Append Search_properties_cmd.CreateParameter("param3", 200, 1, 255, Search_properties__varType_English) ' adVarChar
Search_properties_cmd.Parameters.Append Search_properties_cmd.CreateParameter("param4", 200, 1, 255, Search_properties__varBedrooms) ' adVarChar
Search_properties_cmd.Parameters.Append Search_properties_cmd.CreateParameter("param5", 200, 1, 255, Search_properties__varBathrooms) ' adVarChar
Search_properties_cmd.Parameters.Append Search_properties_cmd.CreateParameter("param6", 5, 1, -1, Search_properties__varPrice) ' adVarChar
Pero ahora me sale el siguiente error:

Código:
ADODB.Command error '800a0d5d'

Application uses a value of the wrong type for the current operation.

/search_property.asp, line 59
La linea 59 es justo la ultima, la del Precio

Última edición por elielbeck; 11/09/2012 a las 08:21