Moin, moin,
wir benötigen:
1 Form
1 OpenDialog
1 DBGrid
1 DBLookupComboBox
2 ClientDataSet
2 DataSource
1 Button
Delphi-Quellcode:
procedure TForm3.Button1Click(Sender: TObject);
begin
OpenDialog1.InitialDir:= 'C:\Programme\Borland\Delphi7\Demos\DbClx\mybasexplorer';
if (not OpenDialog1.Execute())
then exit;
DataSource1.DataSet:= ClientDataSet1;
DataSourceLookUp.DataSet:= ClientDataSetLookUp;
DBGrid1.DataSource:= DataSource1;
ClientDataSet1.FileName:= OpenDialog1.FileName;
ClientDataSet1.Active:= true;
ClientDataSetLookUp.FileName:= OpenDialog1.FileName;
ClientDataSetLookUp.Active:= true;
DBLookupComboBox1.DataSource:= DataSource1;
DBLookupComboBox1.ListSource:= DataSourceLookUp;
DBLookupComboBox1.KeyField:= 'SIZE';
DBLookupComboBox1.DataField:= 'SIZE';
end;
Das ist zwar ein redundantes Lookup, erklärt aber die Vorgehensweise
Gruß
Malte