Ver Mensaje Individual
  #14 (permalink)  
Antiguo 05/03/2008, 18:18
omanitator
 
Fecha de Ingreso: marzo-2008
Mensajes: 29
Antigüedad: 17 años, 1 mes
Puntos: 1
Re: Buscar y mostrar de una Base de Datos

Buenas noches !

Al final he encontrado lo que buscaba, un supermegabuscador/filtrador de resultados de una base de datos.

Ahora la duda que tengo es la siguiente, ¿porque solo me muestra cuando un campo es perfectamente completo? es decir, si en nick hay puesto "omanitator" no vale con que al buscar escriba "tator" e igual ocurre con el resto de campos.

Le añado parte del codigo (perdon por las molestias)....

----------------------------------------------------------

strSQL = "SELECT * FROM messages WHERE "
If strAuthor <> "" Then
If Request.QueryString("a_type") = "contains" Then
strSQL = strSQL & "message_author LIKE '%" & Replace(strAuthor, "'", "''") & "%' AND "
Else
strSQL = strSQL & "message_author = '" & Replace(strAuthor, "'", "''") & "' AND "
End If
End If
If strEmail <> "" Then
If Request.QueryString("e_type") = "contains" Then
strSQL = strSQL & "message_author_email LIKE '%" & Replace(strEmail, "'", "''") & "%' AND "
Else
strSQL = strSQL & "message_author_email = '" & Replace(strEmail, "'", "''") & "' AND "
End If
End If
If strSubject <> "" Then
If Request.QueryString("s_type") = "contains" Then
strSQL = strSQL & "message_subject LIKE '%" & Replace(strSubject, "'", "''") & "%' AND "
Else
strSQL = strSQL & "message_subject = '" & Replace(strSubject, "'", "''") & "' AND "
End If
End If
If strBody <> "" Then
If Request.QueryString("b_type") = "contains" Then
strSQL = strSQL & "message_body LIKE '%" & Replace(strBody, "'", "''") & "%' AND "
Else

------------------------------
Un saludo y muchas gracias a todos.