procedure TFormbearb.ButtonausClick(Sender: TObject);
var query:ANSIstring;
begin
datamodule1.ADOQuery3.SQL.Clear;
if lb.ItemIndex >=0
then
begin
query:= '
SELECT Fr.ID, Fr.Fach, Fr.Schwierigkeit, Fr.Frage, Fr.L1, Fr.L2, Fr.L3, Fr.Lösung FROM Faecher Fa, Fragen Fr '+
'
WHERE Fa.Fach = Fr.Fach and '+
'
Fr.Fach = ' +#39+lb.Items.Strings[lb.ItemIndex]+#39 +
'
ORDER BY Fr.ID ';
Datamodule1.ADOQuery3.SQL.Add(
query);
Datamodule1.ADOQuery3.Open;
TStringGrid(DB2).ColWidths[1]:=30;
TStringGrid(DB2).ColWidths[2]:=60;
TStringGrid(DB2).ColWidths[3]:=30;
TStringGrid(DB2).ColWidths[4]:=220;
TStringGrid(DB2).ColWidths[5]:=150;
TStringGrid(DB2).ColWidths[6]:=150;
TStringGrid(DB2).ColWidths[7]:=150;
TStringGrid(DB2).ColWidths[8]:=20;
end else
begin
application.MessageBox('
Auswahlfehler!','
Fehler');
end;
end;