
18/02/2003, 15:40
|
 | | | Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 23 años, 1 mes Puntos: 1 | |
pon esto:
Busqueda=Split(Replace(Request.Form("busqueda"),"' ","''")," ")
strsql="SELECT * FROM PRODUCTOS WHERE NOMBRE LIKE '%"&Busqueda(0)&"%' "
If Ubound(Busqueda)>0 Then
For i=1 to Ubound(Busqueda)
strsql=strsql&" OR autor LIKE '%"&Busqueda(i)&"%' "
Next
End If
SET objRS=objConn.Execute(SQL)
y busca
cacho juan
El problema viene cuando solo ingresas una cadena de texto así que has esto
if instr(Request.Form("busqueda")," ") Then
Busqueda=Split(Replace(Request.Form("busqueda"),"' ","''")," ")
strsql="SELECT * FROM PRODUCTOS WHERE NOMBRE LIKE '%"&Busqueda(0)&"%' "
If Ubound(Busqueda)>0 Then
For i=1 to Ubound(Busqueda)
strsql=strsql&" OR autor LIKE '%"&Busqueda(i)&"%' "
Next
End If
Else
strsql="SELECT * FROM PRODUCTOS WHERE NOMBRE LIKE '%"&Request.Form("busqueda")&"%' "
SET objRS=objConn.Execute(SQL)
End if
Saludos |