Ver Mensaje Individual
  #3  
Antiguo 05-12-2007
rafita rafita is offline
Miembro
 
Registrado: ago 2003
Ubicación: Cuenca- España.
Posts: 309
Reputación: 21
rafita Va por buen camino
Como te ha dicho el compañero, utilizando parámetros se soluciona, pero también puedes utilizar la función QuotedStr, por ejemplo:

Código:
 
// busqueda exacta
sql.Add('select * from SUJETOS where APELLIDO = '+QuotedStr(trim(ape)));
// compenzando por
sql.Add('select * from SUJETOS where APELLIDO LIKE '+QuotedStr(trim(ape) + '%'));
// o conteniendo
sql.Add('select * from SUJETOS where APELLIDO LIKE '+QuotedStr('%' + trim(ape) + '%'));
Saludos
__________________
Rafita.
Responder Con Cita