1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| With ADOQuery1 do
begin
Sql.Clear;
Sql.Add('SELECT * FROM table1 ');
Sql.Add('Where Année= :xAnnée ');
Sql.Add('And Situation= :xSituation ');
Parameters.ParamByName('xAnnée').DataType := ftInteger;
Parameters.ParamByName('xSituation').DataType := ftString;
Parameters.ParamByName('xAnnée').Value := StrToIntDef(ComboBox3.text,'2008');
// Possible aussi pour Combobox3
// if ComboBox.itemIndex <> - 1
// then Parameters.ParamByName('xAnnée').Value := StrToInt(ComboBox3.Strings[ComboBox3.itemIndex])
// else Parameters.ParamByName('xAnnée').Value := 2008;
Parameters.ParamByName('xSituation').Value := Edit3.text;
Try
Open;
// ... ici fait ton traitement
Finally
Close;
end;
end; |