Ver Mensaje Individual
  #9  
Antiguo 25-07-2014
Avatar de ozsWizzard
ozsWizzard ozsWizzard is offline
Miembro
 
Registrado: may 2004
Ubicación: Murcia
Posts: 190
Reputación: 20
ozsWizzard Va por buen camino
Si el campo es texto, debería de ir entre comillas. Para ponerle las comillas yo uso la función QuotedStr:

Código Delphi [-]
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
 Try
      Begin
        If Edit1.Text<>Null Then
          Begin
            DataModule1.ADOQuery1.Close;
            DataModule1.ADOQuery1.SQL.Clear;
            DataModule1.ADOQuery1.Prepared;
            DataModule1.ADOQuery1.SQL.Add('SELECT * FROM CLIENTE A WHERE A.CLAVE= ' + QuotedStr(Edit1.Text));
            DataModule1.ADOQuery1.ParamCheck:=True;
            DataModule1.ADOQuery1.Open;
            Form2 := TForm2.Create(Self);
            Form2.Show;
          End
        Else
      End
    Except
      ShowMessage('Lo siento no pude abrir la base de datos');
    End
End;
__________________
La Madurez se llama...
~~~Gaia~~~

Última edición por ozsWizzard fecha: 25-07-2014 a las 07:44:32.
Responder Con Cita