想在点击按钮'查询'时显示一个FORM 提示 '请稍候...'
但是出现的form是个空白页面,里面的label1不能显示,为什么,请大家指点.我的代码如下:procedure TForm1.Button1Click(Sender: TObject);
var i,j:integer;
begin
j:=0;
form2.Show;
if edit1.Text='' then
sqlquery1.SQL.text:='select top 10000 * from stb058'
else
sqlquery1.SQL.Text:='select * from stb058 where LeafID='+trim(edit1.Text);
sqlquery1.Open;
for i:=1 to sqlquery1.FieldCount do
stringgrid1.Cells[i,0]:=sqlquery1.Fields.Fields[i-1].DisplayName;
while not sqlquery1.Eof do
begin
j:=j+1;
for i:=1 to sqlquery1.FieldCount do
begin
stringgrid1.Cells[i,j]:=sqlquery1.Fields.Fields[i-1].AsString;
stringgrid1.Cells[0,j]:=inttostr(j);
end ;
sqlquery1.Next;
end;
stringgrid1.RowCount:=sqlquery1.RecordCount+1;
stringgrid1.ColCount:=sqlquery1.FieldCount;
form2.Close;
sqlquery1.Close;end;
但是出现的form是个空白页面,里面的label1不能显示,为什么,请大家指点.我的代码如下:procedure TForm1.Button1Click(Sender: TObject);
var i,j:integer;
begin
j:=0;
form2.Show;
if edit1.Text='' then
sqlquery1.SQL.text:='select top 10000 * from stb058'
else
sqlquery1.SQL.Text:='select * from stb058 where LeafID='+trim(edit1.Text);
sqlquery1.Open;
for i:=1 to sqlquery1.FieldCount do
stringgrid1.Cells[i,0]:=sqlquery1.Fields.Fields[i-1].DisplayName;
while not sqlquery1.Eof do
begin
j:=j+1;
for i:=1 to sqlquery1.FieldCount do
begin
stringgrid1.Cells[i,j]:=sqlquery1.Fields.Fields[i-1].AsString;
stringgrid1.Cells[0,j]:=inttostr(j);
end ;
sqlquery1.Next;
end;
stringgrid1.RowCount:=sqlquery1.RecordCount+1;
stringgrid1.ColCount:=sqlquery1.FieldCount;
form2.Close;
sqlquery1.Close;end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货