?? untpubquerydb.pas
字號:
unit untPubQueryDB;
///////////管理 監(jiān)視遠程數(shù)據(jù)庫的應(yīng)用程序ydy 2004-4-22 create
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, DBGrids, Buttons, DB;
type
TFm_RemoteDb = class(TForm)
Label1: TLabel;
DBGrid1: TDBGrid;
EdtTable: TEdit;
Label2: TLabel;
BtnSelect: TButton;
edtRecNo: TEdit;
Label3: TLabel;
ComboBox1: TComboBox;
BtnDo: TButton;
Memo1: TMemo;
Label4: TLabel;
btnpagedown: TBitBtn;
DataSource1: TDataSource;
BitBtn1: TBitBtn;
procedure BtnSelectClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure BtnDoClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Fm_RemoteDb: TFm_RemoteDb;
implementation
uses Data, func, untdatadm;
{$R *.dfm}
procedure TFm_RemoteDb.BtnSelectClick(Sender: TObject);
var
t_sql:string;
quedata:olevariant;
//2004-2-10為了優(yōu)化程序性能 速度已提高到52秒
begin
screen.Cursor := crhourglass;
//關(guān)掉與DBGRID 的互動
dmmain.dsquery.DisableControls;
quedata:=null;
if dmmain.dsquery.active then dmmain.dsquery.close;
t_sql:='select top ' + ComboBox1.Text+MEMO1.Text;
try
ipubtemp.ty_query(t_sql,quedata);
if not varisnull(quedata) then
begin
if dmmain.dsquery.Active then dmmain.dsquery.Close;
dmmain.dsquery.Data:=quedata;
dmmain.dsquery.Open;
dmmain.dsquery.Last;
edtRecNo.Text := '當前已下載: '+inttostr(dmmain.dsquery.recordcount)+'條';
dmmain.dsquery.EnableControls;
end else
begin
//不再有數(shù)據(jù)
dmmain.dsquery.EnableControls; //ydy 必須要
screen.Cursor := crdefault;
exit;
end;
except
end;
dbgrid1.Refresh;
dmmain.dsquery.EnableControls; //ydy add 2004-4-13
screen.Cursor := crdefault;
end;
procedure TFm_RemoteDb.FormShow(Sender: TObject);
begin
if dmmain.dsquery.active then dmmain.dsquery.close;
dmmain.dsquery.Data:=null;
end;
procedure TFm_RemoteDb.BtnDoClick(Sender: TObject);
var
t_sql:string;
quedata:olevariant;
begin
screen.Cursor := crhourglass;
try
t_sql := trim(memo1.Text);
ipubtemp.scrapsate(t_sql);
except
end;
screen.Cursor := crdefault;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -