Einzelnen Beitrag anzeigen

Benutzerbild von haentschman
haentschman

Registriert seit: 24. Okt 2006
Ort: Seifhennersdorf / Sachsen
5.388 Beiträge
 
Delphi 12 Athens
 
#6

AW: Wie drucken Sie Name und Note in FASTREPORT?

  Alt 13. Sep 2020, 07:13
Hi...
 SQL.Add('JOIN ETUDIANT E on EL.ID=EL.ID'); ...i think this line is wrong. 'on EL.ID=EL.ID'...the same field in the join.
 SQL.Add('JOIN ETUDIANT E on EL.ID=E.ID'); ...how about this?

notes:
* Dont use WITH. Then you have less debugging problems with missing variable values.
* why Close/Clear? If you use SQL.Text, the SQL.Clear automaticly executed. With FireDAC the Close is automaticly executed.
* U use FIREDAC with MACROS. The problem is...that, if you changing the database components, the new one not knows MACROS. And one line less...

imho better:
Delphi-Quellcode:
procedure TForm4.Button4Click(Sender: TObject);
begin
  dmdata.AFDQuery.SQL.Text := 'SELECT E.NOM,L.NOMLECON FROM ETUDLECON EL';
  dmdata.AFDQuery.SQL.Add('JOIN LECON L ON EL.ID=L.LECONID');
  dmdata.AFDQuery.SQL.Add('JOIN ETUDIANT E on EL.ID=EL.ID');
  dmdata.AFDQuery.SQL.Add('ORDER BY EL.ID,EL.LECONID');

  dmdata.AFDQuery.Open;

  DmData.frxReport1.ShowReport;
end;
  Mit Zitat antworten Zitat