多线程查询

//==============================================================================
// 多线程查询      cxg           2008-09-26 14:29:42
//==============================================================================

unit uSelect;

interface

uses
  sysUtils,ADODB,Classes;

type
  TSelect = class(TThread)
  private
    FAdoConnection:TADOConnection;
    FAdoquery:TADOQuery;
    FSql:String;
  protected
    procedure Execute;override;
  public
    constructor create(AdoConnection:TADOConnection;AdoQuery:TADOQuery;Sql:string);
end;

implementation

{ Tselect }

constructor Tselect.create(AdoConnection:TADOConnection;AdoQuery:TADOQuery;Sql:string);
begin
  inherited create(False);
  FreeOnTerminate:=True;
  FAdoConnection:=AdoConnection;
  FAdoquery:=AdoQuery;
  FSql:=Sql;
end;

procedure Tselect.Execute;
begin
  with FAdoquery do
  begin
    Close;
    SQL.Clear;
    SQL.Add(fsql);
    Open;
  end;
end;

end.

 

posted @ 2008-09-26 14:30  delphi中间件  阅读(228)  评论(0编辑  收藏  举报