begin
ADODataSet.Connection := Mainform.ADOConnection;
ADODataSet.CommandText := 'Select id from Table1';
ADODataSet.Open;
if ADODataSet.Recordset.BOF or ADODataSet.Recordset.EOF
then
else ADODataSet.Recordset.MoveFirst;
While not ADODataSet.Recordset.EOF do
begin
if ADODataSet.Recordset.BOF or ADODataSet.Recordset.EOF then
else
begin
ComboBox1.Items.Add(String(ADODataSet.Recordset.Fields[0].value));
ADODataSet.Recordset.MoveNext;
end;
end;
ADODataSet.Close;
end;