一个数据库查询多线程封装.dll问题(100分)

  • 主题发起人 主题发起人 灵鸽
  • 开始时间 开始时间

灵鸽

Unregistered / Unconfirmed
GUEST, unregistred user!
destructor TQueryThread.Destroy;
begin
CoUnInitialize;
inherited Destroy;
end;
procedure TQueryThread.Execute;
var
i: Integer;
j: string;
begin
CoInitialize(nil);
i := 1;
j := '☆';
UserManager.bsSkinListBox1.Items.Clear;
with UserManager.ADOQuery1do
begin
sql.Clear;
sql.Add(SqlStr);
open;
if (eof) and (bof) then
begin
application.MessageBox('未找到用户信息!', '提示', mb_iconwarning);
close;
Exit;
end;
while not eofdo
begin
if j = '☆☆☆☆☆☆☆☆' then
j := '☆';
if SotpQuery = True then
begin
close;
Exit;
end;
UserManager.bsSkinStatusPanel1.Caption := '正在搜索中' + j;
UserManager.bsSkinStatusPanel2.Caption := '找到用户数:' + inttostr(i);
UserManager.bsSkinGroupBox1.Caption := '用户列表(' + inttostr(i) + ')';
UserManager.bsSkinListBox1.Items.Add(fields[0].AsString);
i := i + 1;
j := j + '☆';
Next;
end;
close;
end;
UserManager.bsSkinListBox1.ItemIndex := 0;
end;

多线程查询的数据库公用模块怎么封将成为DLL?
还有怎么动态调用,请出例子谢谢。
 
做成DLL很简单,只不过由于是COM,很多细节要注意啊
 
发到你的email
 
接受答案了.
 
后退
顶部