急急急快被炒掉了 ProgressBar在查询中的如何应用? 我的要求是象安装程序一样,刚查询就启动进程条,进程条的速度和查询同步,等查询结束,进程条也显示结束,最好还能有个百分比显示(在BDE下) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure TFRMBoxInvMst.FilePrintSetupExecute(Sender: TObject);var AForm: TForm; ALabel: TLabel; APBar: TProgressBar; NoteNo: String;begin inherited; NoteNo := ''; AForm := TForm.Create(nil); try with AForm do begin Caption := '進度條...'; Height := 150; Width := 400; BorderIcons := []; Position := poScreenCenter; end; ALabel := TLabel.Create(AForm); APBar := TProgressBar.Create(AForm); ALabel.Caption := '正在准備報表數據, 請稍候...'; ALabel.Top := 20; ALabel.Left := 30; ALabel.Width := AForm.Width - 2* ALabel.Left; ALabel.Parent := AForm; APBar.Top := 55; APBar.Left := ALabel.Left; APBar.Smooth := True; APBar.Width := ALabel.Width; APBar.Min := 0; APBar.Max := 1000; APBar.Step := Trunc(APBar.Max / MasterDataSet.RecordCount); APBar.Parent := AForm; AForm.Show; NoteNo := NewNoteNo('ABOXINVPD'); DM.csCommand.Active := False; DM.csCommand.CommandText := 'INSERT INTO BOXINVPD(CMPYCD, NOTENO, PATCODE, BILLQTY, CREATEUSERID)' + ' VALUES(:CMPYCD, :NOTENO, :PATCODE, :BILLQTY, :CUSERID)'; DM.csCommand.Params.ParseSQL(DM.csCommand.CommandText, True); with MasterDataSet do begin DisableControls; First; while not eof do begin DM.csCommand.Params.ParamByName('CMPYCD').AsString := DM.csCmpy.FieldValues['CUSTOMERCD']; DM.csCommand.Params.ParamByName('NOTENO').AsString := NoteNo; DM.csCommand.Params.ParamByName('PATCODE').AsString := FieldByName('PATCODE').AsString; DM.csCommand.Params.ParamByName('BILLQTY').AsInteger := FieldByName('TQTY').AsInteger; DM.csCommand.Params.ParamByName('CUSERID').AsString := DM.SystemInfo.CurrentUser.ID; DM.csCommand.Execute; Next; APBar.StepIt; APBar.Update; AForm.Update; end; EnableControls; end; MsgBox('盤點報表數據處理完畢! '); finally AForm.Release; end;end; 这就需要你首先知道你要查询的数据的总条数,然后才可以做进度条。每查到一定数量的记录就将ProgressBar.StepIt to chutian(我很丑???) 在未打开数据之前,如何得知masterdataset.recordcount????APBar.Step := Trunc(APBar.Max / MasterDataSet.RecordCount);还有DM.csCommand是什么??麻烦您告之,谢谢 DBGrid的问题 请问如何在程序中关闭用showmessage打开的对话框 怎样用fastreport打印stringgrid中的数据呢? 如何得到电脑的网络速度? 有谁能以详细解释,关Delphi中Demos--midas--login中原理,认我参透其中的原理 delphiWORD内容关闭 有关用ADO操作数据库的问题。 用TADOQuery.Clone方法克隆的数据集如何存入数据库?100分 怎么在所有Edit都填完信息之后激活按钮 这个函数怎样去写? 怎样取得SQL执行后的返回值,比如:。。。。。 程序退出后,不能结束程序的进程,up者有分
var
AForm: TForm;
ALabel: TLabel;
APBar: TProgressBar; NoteNo: String;
begin
inherited;
NoteNo := '';
AForm := TForm.Create(nil);
try
with AForm do
begin
Caption := '進度條...';
Height := 150;
Width := 400;
BorderIcons := [];
Position := poScreenCenter;
end;
ALabel := TLabel.Create(AForm);
APBar := TProgressBar.Create(AForm); ALabel.Caption := '正在准備報表數據, 請稍候...';
ALabel.Top := 20;
ALabel.Left := 30;
ALabel.Width := AForm.Width - 2* ALabel.Left;
ALabel.Parent := AForm; APBar.Top := 55;
APBar.Left := ALabel.Left;
APBar.Smooth := True;
APBar.Width := ALabel.Width;
APBar.Min := 0;
APBar.Max := 1000;
APBar.Step := Trunc(APBar.Max / MasterDataSet.RecordCount);
APBar.Parent := AForm; AForm.Show; NoteNo := NewNoteNo('ABOXINVPD'); DM.csCommand.Active := False;
DM.csCommand.CommandText := 'INSERT INTO BOXINVPD(CMPYCD, NOTENO, PATCODE, BILLQTY, CREATEUSERID)'
+ ' VALUES(:CMPYCD, :NOTENO, :PATCODE, :BILLQTY, :CUSERID)';
DM.csCommand.Params.ParseSQL(DM.csCommand.CommandText, True);
with MasterDataSet do
begin
DisableControls;
First;
while not eof do
begin
DM.csCommand.Params.ParamByName('CMPYCD').AsString := DM.csCmpy.FieldValues['CUSTOMERCD'];
DM.csCommand.Params.ParamByName('NOTENO').AsString := NoteNo;
DM.csCommand.Params.ParamByName('PATCODE').AsString := FieldByName('PATCODE').AsString;
DM.csCommand.Params.ParamByName('BILLQTY').AsInteger := FieldByName('TQTY').AsInteger;
DM.csCommand.Params.ParamByName('CUSERID').AsString := DM.SystemInfo.CurrentUser.ID; DM.csCommand.Execute;
Next;
APBar.StepIt;
APBar.Update;
AForm.Update;
end;
EnableControls;
end;
MsgBox('盤點報表數據處理完畢! ');
finally
AForm.Release;
end;
end;
在未打开数据之前,如何得知masterdataset.recordcount????
APBar.Step := Trunc(APBar.Max / MasterDataSet.RecordCount);
还有DM.csCommand是什么??麻烦您告之,谢谢