C
coolingxyz
Unregistered / Unconfirmed
GUEST, unregistred user!
我现在把connstr用参数传进来了,还是不行呀。怎么回事?
type
Tmythread = class(TThread)
private
PFhIp : PStrIp;
constr : String;
rec : Boolean;
protected
procedure Execute;
override;
Function Query( PNode: TTreeNode) : Boolean;
Public
constructor Create(TFhIp : TstrIp;
Connstr : String;
recording : Boolean);
Destructor Destroy;
Override;
end;
procedure Tmythread.Execute;
begin
{ Place thread code here }
FreeOnTerminate := True;
//线程做完后终止
if not terminated then
Stordata;
end;
Function Tmythread.Query(PNode : TTreeNode) : Boolean;
var
adoq : TADOQuery;
begin
try
CoInitialize(nil);
try
with adoqdo
begin
ConnectionString := constr;
Active := False;
sql.Clear;
//其他操作。
end;
//with
finally
ADOq.free;
end;
finally
CoUninitialize;
result := True;
end;
end;
type
Tmythread = class(TThread)
private
PFhIp : PStrIp;
constr : String;
rec : Boolean;
protected
procedure Execute;
override;
Function Query( PNode: TTreeNode) : Boolean;
Public
constructor Create(TFhIp : TstrIp;
Connstr : String;
recording : Boolean);
Destructor Destroy;
Override;
end;
procedure Tmythread.Execute;
begin
{ Place thread code here }
FreeOnTerminate := True;
//线程做完后终止
if not terminated then
Stordata;
end;
Function Tmythread.Query(PNode : TTreeNode) : Boolean;
var
adoq : TADOQuery;
begin
try
CoInitialize(nil);
try
with adoqdo
begin
ConnectionString := constr;
Active := False;
sql.Clear;
//其他操作。
end;
//with
finally
ADOq.free;
end;
finally
CoUninitialize;
result := True;
end;
end;