Ver Mensaje Individual
  #23 (permalink)  
Antiguo 01/10/2010, 11:36
ncianc
 
Fecha de Ingreso: julio-2010
Mensajes: 35
Antigüedad: 13 años, 10 meses
Puntos: 0
Respuesta: Busqueda Multiple en .asp

sql = " select * from Plans "

If(poo <>"") then
sql2 = sql2 & " WHERE Pool LIKE '%" & poo & "%' "
end if

If(sta <>"") then
sql2 = sql2 & " WHERE Status LIKE '%" & sta & "%' "
end if

If(poo <>"" and sta <>"") then
sql2 = sql2 & " WHERE Status LIKE '%" & sta & "%' and Pool LIKE '%" & poo & "%' "
end if

'concateno variables
sql = sql & sql2

'espero que tu coneccion sea buena.
dbfile=Server.MapPath("fpdb/ticketsgenerales.mdb")
Set OBJdbConnection=Server.CreateObject("ADODB.Connect ion")
OBJdbConnection.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&dbfile
response.write sql
response.end
rs.Open Sql, OBJdbConnection, 1, 1%>