Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/12/2003, 19:23
individuo_YO?
 
Fecha de Ingreso: diciembre-2003
Mensajes: 5
Antigüedad: 20 años, 5 meses
Puntos: 0
Pregunta Revisenme esto Por fa!

El siguiente codigo se supone que deberia tomar 3 variables de formulario "marca", "ano", "precio" a partir de estos crear un juego de registros.
pero, si alguna de las variables es "0" no deberia excluir ningun registro...
me doy a entender...?
y pa variar no me resulta......
si alguien sabe como lo puedo hacer o que tiene de malo este codigo por fabor hagamelo saber....

Tabla : rsR

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/info_auto.asp" -->
<%
Dim rsR__varMarca
rsR__varMarca = "0"
If (Request.QueryString("marca") <> "") Then
rsR__varMarca = Request.QueryString("marca")
End If
%>
<%
Dim rsR__varAno
rsR__varAno = "0"
If (Request.QueryString("ano") <> "") Then
rsR__varAno = Request.QueryString("ano")
End If
%>
<%
Dim rsR__varPrecio
rsR__varPrecio = "0"
If (Request.QueryString("precio") <> "") Then
rsR__varPrecio = Request.QueryString("precio")
End If
%>
<% Dim h1 as string
h1 = "SELECT puesto, marca, modelo, categoria, ano, cod_precio, precio FROM automotriz WHERE"
%>
<%
If (Request.QueryString("marca") <> "0")Then
h1 = h1 + "marca LIKE '" + Replace(rsR__varMarca, "'", "''") + "'"
End If
%>
<%
If (Request.QueryString("ano") <> "0")Then
h1 = h1 + "AND ano LIKE" + Replace(rsR__varAno, "'", "''")
End If %>
<% If (Request.QueryString("precio") <> "0")Then
h1 = h1 + "AND cod_precio LIKE " + Replace(rsR__varPrecio, "'", "''")
End If %>
<%
Dim rsR
Dim rsR_numRows
Set rsR = Server.CreateObject("ADODB.Recordset")
rsR.ActiveConnection = MM_info_auto_STRING
rsR.Source = h1 + "ORDER BY puesto ASC"
rsR.CursorType = 0
rsR.CursorLocation = 2
rsR.LockType = 1
rsR.Open()

rsR_numRows = 0
%>