
06/02/2004, 18:15
|
 | | | Fecha de Ingreso: diciembre-2003 Ubicación: Frente al Monitor
Mensajes: 252
Antigüedad: 21 años, 5 meses Puntos: 0 | |
Ayuda con mensaje Hola a todos
Tengo el siguiente problema tengo una consulta por medio de 3 combobox lo quiero que haga es que si al consultar con los tres combo no da ningun resultado con esas caracteristicas me mande un error. Mi codigo esta asi:
<%
dim BDDD
dim table
dim SQL1
Marca = Trim(Request.QueryString("Marca"))
Valor1 = Trim(Request.QueryString("Mega"))
Valor2 = Trim(Request.QueryString("Zoom"))
Set BDDD = Server.CreateObject ("ADODB.Connection")
Set table = Server.CreateObject ("ADODB.RecordSet")
BDDD.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0 ;DATA SOURCE=" + Server.MapPath(".\Productos.mdb"))
sqlWhere = ""
if Marca<>"" and ucase(Marca)<>"CUALQUIERA" then
if sqlWhere <> "" then sqlWhere=sqlWhere & " AND "
sqlWhere = sqlWhere & " Marca = '" & Marca & "'"
end if
if Valor1<>"" and ucase(Valor1)<>"CUALQUIERA" then
if sqlWhere <> "" then sqlWhere=sqlWhere & " AND "
sqlWhere = sqlWhere & " Valor1 = '" & Valor1 & "'"
end if
if Valor2<>"" and ucase(Valor2)<>"CUALQUIERA" then
if sqlWhere <> "" then sqlWhere=sqlWhere & " AND "
sqlWhere = sqlWhere & " Valor2 = '" & Valor2 & "'"
end if
' Finalmente arma el SQl
strSql = "SELECT * FROM Productos WHERE Producto LIKE 'Camaras' AND Publicar=True"
IF sqlWhere <> "" then strSql = strSql & " AND " & sqlWhere
table.ActiveConnection=BDDD
table.Open strSql
Como puedo hacer esto. Por su ayuda mil gracias.
__________________ Hasta la victoria Siempre. |