Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Firebird e Interbase (https://www.clubdelphi.com/foros/forumdisplay.php?f=19)
-   -   Consulta con IBDataset (https://www.clubdelphi.com/foros/showthread.php?t=15023)

noe 07-10-2004 17:48:40

Consulta con IBDataset
 
Saludos a todos los compañeros del foro mi pregunta es la siguiente con un componente IBQuery realizo asi mis consultas:

procedure TForm1.Button1Click(Sender: TObject);
var
VarMatricula:string;

begin
VarMatricula:=uppercase(inputbox('Busqueda por matrícula de alumno','Introduzca la matrícula',''));
IBQuery1.Close;
IBQuery1.SQL.Clear;
IBQuery1.SQL.Add('select *');
IBQuery1.SQL.Add('from Alumnos');
IBQuery1.sql.Add('Where upper(Matricula) like :Matr');
IBQuery1.ParamByName('Matr').AsString:=VarMatricula;
IBQuery1.Open;

end;

Mi pregunta es como lo hago con un IBDataset, manejo firebird 1.5 y delphi 5.

gracias

gendelphi 07-10-2004 22:22:52

Código Delphi [-]
IBDataSet1.Close;
IBDataSet1.SelectSQL.Clear;
IBDataSet1.SelectSQL.Add('select *');
IBDataSet1.SelectSQL.Add('from Alumnos');
IBSataSet1.SelectSQL.Add('Where upper(Matricula) like :Matr');
IBDataSet1.ParamByName('Matr').AsString:=VarMatricula;
IBDataSet1.Open;

noe 08-10-2004 16:11:16

Gracias me sirvio, solo que el parametro parambyname no me lo acepto y lo cambie por este otro:
IBDataSet1.Params.ByName('mat').Asinteger:=strtoint(VarMatricula);

Gracias por todo, como siempre se puede contar con este foro para casos en que necesitamos de una ayuda. :)


La franja horaria es GMT +2. Ahora son las 22:57:29.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi