麻烦请问为什么下面2个查询,只能用一个,若2个同时使用就查询不到想要的结果了
麻烦请问为什么下面2个查询,只能用一个,若2个同时使用就查询不到想要的结果了?谢谢begin
ADOQuery1.ConnectionString :='Provider=Microsoft.jet.OLEDB.4.0; Data Source='
+ ExtractFilePath(Application.ExeName)+'LD.mdb;Persist Security Info=False';
With ADOQuery1 do
begin
Close;
Sql.Text:='Select distinct lifetime from data1 where lamptype= "E19.5H 225W"' ;
Open;
end;
if ADOQuery1.RecordCount>0 then
begin
while Not ADOQuery1.Eof do
begin
ComboBox4.Items.Add(ADOQuery1.Fields[0].AsString);
ADOQuery1.Next;
With ADOQuery1 do
begin
Close;
/SQL.Clear;
//Sql.Add('Select distinct sn from data1') ;
//Open;
//end;
//if ADOQuery1.RecordCount>0 then
//begin
// while Not ADOQuery1.Eof do
// begin
//ComboBox3.Items.Add(ADOQuery1.Fields[0].AsString);
// ADOQuery1.Next;