W
wjlsmail
Unregistered / Unconfirmed
GUEST, unregistred user!
您好,在如下结构中:
with TADOQuery.Create(self) do
begin
try
begin
ConnectionString := '...' ;
Sql.Add('Select Count(*) as counts from table');
Sql.Add('Select FieldName from table');
Open;
Label1.Caption := FieldByName('counts').AsString;
Label2.Caption := FieldByName('FieldName').AsString; //提示: 没有FieldName字段
end;
finally
Free;
end;
end;
第二个查询的字段不能找到,请教如何才能访问到多个Select 语句的结果,就用这种结构,谢谢
with TADOQuery.Create(self) do
begin
try
begin
ConnectionString := '...' ;
Sql.Add('Select Count(*) as counts from table');
Sql.Add('Select FieldName from table');
Open;
Label1.Caption := FieldByName('counts').AsString;
Label2.Caption := FieldByName('FieldName').AsString; //提示: 没有FieldName字段
end;
finally
Free;
end;
end;
第二个查询的字段不能找到,请教如何才能访问到多个Select 语句的结果,就用这种结构,谢谢