现在有分了,不多,大家来看看。 在线等(20分)

  • 主题发起人 coolingxyz
  • 开始时间
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;
 
Function Tmythread.Query(PNode : TTreeNode) : Boolean;
var
adoq : TADOQuery;
begin
adoq := tadoquery.create(nil);
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;
 
接受答案了.
 
顶部