Z
zhouxiaochenchi
Unregistered / Unconfirmed
GUEST, unregistred user!
线程代码如下
unit DBOpenThread;
interface
uses
Classes,ActiveX,ADODB,SysUtils,wwdbgrid,db;
type
myThread = class(TThread)
private
{ Private declarations }
strThreadUser:string;
strThreadTableName:string;
procedure DisplayMessage;
procedure ClearMessage;
Procedure LoadGridColumn;
procedure HookUpUI;
procedure QueryError;
//procedure SetDBGridControlType(DBG: TwwDBGrid);
protected
procedure Execute;
override;
public
constructor Create(strUser,strTableName:string);
end;
implementation
uses Data,main;
constructor myThread.Create(strUser,strTableName:string);
begin
inherited Create(true);
strThreadUser:=strUser;
strThreadTableName:=strTableName;
FreeOnTerminate := True;
Resume;
end;
procedure myThread.LoadGridColumn;
var
qrytemp:Tadoquery;
inti:Integer;
begin
qrytemp:=tadoquery.Create(nil);
try
qrytemp.Connection:=DataForm.ADOConn;
qrytemp.SQL.Clear;
qrytemp.SQL.Add('select * from PubDBGridStyle where PubLoginUser='''+strThreadUser+''' and PubTableName='''+strThreadTableName+''' and PubColVisible=1 order by PubDisSN ASC');
qrytemp.Open;
qrytemp.First;
FormMain.DBGrid.Selected.begin
Update;
FormMain.DBGrid.Selected.Clear;
for inti:=0 to qrytemp.RecordCount-1do
begin
FormMain.DBGrid.Selected.Add(qrytemp.FieldByName('PubKeyName').AsString+#9+
qrytemp.FieldByName('PubDisWidth').AsString+#9+
qrytemp.FieldByName('PubDisName').AsString);
qrytemp.Next;
end;
FormMain.DBGrid.Selected.EndUpdate;
//SetDBGridControlType(FormMain.DBGrid);
finally
qrytemp.Free;
end;
end;
procedure myThread.Execute;
begin
{ Place thread code here }
try
CoInitialize(nil);
DisplayMessage;
LoadGridColumn;
FormMain.DBGrid.DataSource:=DataForm.DataSource;
FormMain.DBGrid.DataSource.DataSet.DisableControls;
case FormMain.IntFormFlag of
1: begin
//FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCorp.Close;
DataForm.ADOQueryCorp.SQL.Clear;
DataForm.ADOQueryCorp.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCorp.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
2: begin
//FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCountry.Close;
DataForm.ADOQueryCountry.SQL.Clear;
DataForm.ADOQueryCountry.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCountry.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
3: begin
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryProvince.Close;
DataForm.ADOQueryProvince.SQL.Clear;
DataForm.ADOQueryProvince.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryProvince.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
4: begin
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCity.Close;
DataForm.ADOQueryCity.SQL.Clear;
DataForm.ADOQueryCity.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCity.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
5: begin
//港口
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryPort.Close;
DataForm.ADOQueryPort.SQL.Clear;
DataForm.ADOQueryPort.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryPort.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
6: begin
//航线
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQuerySeaLine.Close;
DataForm.ADOQuerySeaLine.SQL.Clear;
DataForm.ADOQuerySeaLine.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQuerySeaLine.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
7: begin
//船舶
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryBoat.Close;
DataForm.ADOQueryBoat.SQL.Clear;
DataForm.ADOQueryBoat.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryBoat.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
8: begin
//包装类型
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryPackType.Close;
DataForm.ADOQueryPackType.SQL.Clear;
DataForm.ADOQueryPackType.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryPackType.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
9: begin
//集装箱型号
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCntSize.Close;
DataForm.ADOQueryCntSize.SQL.Clear;
DataForm.ADOQueryCntSize.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCntSize.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
10: begin
//运输条款
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryTrafficTerm.Close;
DataForm.ADOQueryTrafficTerm.SQL.Clear;
DataForm.ADOQueryTrafficTerm.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryTrafficTerm.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
11: begin
//贸易方式
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryTradeMode.Close;
DataForm.ADOQueryTradeMode.SQL.Clear;
DataForm.ADOQueryTradeMode.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryTradeMode.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
12: begin
//报关方式
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCustMode.Close;
DataForm.ADOQueryCustMode.SQL.Clear;
DataForm.ADOQueryCustMode.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCustMode.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
13: begin
//报关状态
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCustStatus.Close;
DataForm.ADOQueryCustStatus.SQL.Clear;
DataForm.ADOQueryCustStatus.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCustStatus.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
14: begin
//退关状态
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCustBack.Close;
DataForm.ADOQueryCustBack.SQL.Clear;
DataForm.ADOQueryCustBack.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCustBack.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
15: begin
//货币种类
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCurr.Close;
DataForm.ADOQueryCurr.SQL.Clear;
DataForm.ADOQueryCurr.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCurr.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
16: begin
//动态汇率
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryRate.Close;
DataForm.ADOQueryRate.SQL.Clear;
DataForm.ADOQueryRate.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryRate.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
17: begin
//费收项目
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryFeeItem.Close;
DataForm.ADOQueryFeeItem.SQL.Clear;
DataForm.ADOQueryFeeItem.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryFeeItem.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
18: begin
//简单费用分类
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQuerySFClass.Close;
DataForm.ADOQuerySFClass.SQL.Clear;
DataForm.ADOQuerySFClass.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQuerySFClass.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
19: begin
//银行帐户
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryAccount.Close;
DataForm.ADOQueryAccount.SQL.Clear;
DataForm.ADOQueryAccount.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryAccount.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
end;
ClearMessage;
CoUninitialize;
finally
FormMain.DBGrid.DataSource.DataSet.EnableControls;
end;
end;
procedure myThread.HookUpUI;
begin
case FormMain.IntFormFlag of
1: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCorp;
end;
2: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCountry;
end;
3: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceProvince;
end;
4: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCity;
end;
5: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourcePort;
end;
6: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceSeaLine;
end;
7: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceBoat;
end;
8: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourcePackType;
end;
9: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCntSize;
end;
10: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceTrafficTerm;
end;
11: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceTradeMode;
end;
12: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCustMode;
end;
13: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCustStatus;
end;
14: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCustBack;
end;
15: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCurr;
end;
16: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceRate;
end;
17: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceFeeItem;
end;
18: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceSFClass;
end;
19: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceAccount;
end;
end;
end;
procedure myThread.QueryError;
begin
end;
procedure myThread.DisplayMessage;
begin
with FormMaindo
StatusBar.Panels[0].Text:='数据下载中,请梢后......';
end;
procedure myThread.ClearMessage;
begin
with FormMaindo
StatusBar.Panels[0].Text:='';
end;
end.
主界面上的一个DBGRID来连接动态连接ADOQUERY
但是,有的时候会出错,提示‘LIST INDEX OUT OF BOUND (2)’,我用的是IP4000里面的WWDBGRID,显示的列,我是动态加载数据库的。(有一个表专门存显示列名,列宽度)
unit DBOpenThread;
interface
uses
Classes,ActiveX,ADODB,SysUtils,wwdbgrid,db;
type
myThread = class(TThread)
private
{ Private declarations }
strThreadUser:string;
strThreadTableName:string;
procedure DisplayMessage;
procedure ClearMessage;
Procedure LoadGridColumn;
procedure HookUpUI;
procedure QueryError;
//procedure SetDBGridControlType(DBG: TwwDBGrid);
protected
procedure Execute;
override;
public
constructor Create(strUser,strTableName:string);
end;
implementation
uses Data,main;
constructor myThread.Create(strUser,strTableName:string);
begin
inherited Create(true);
strThreadUser:=strUser;
strThreadTableName:=strTableName;
FreeOnTerminate := True;
Resume;
end;
procedure myThread.LoadGridColumn;
var
qrytemp:Tadoquery;
inti:Integer;
begin
qrytemp:=tadoquery.Create(nil);
try
qrytemp.Connection:=DataForm.ADOConn;
qrytemp.SQL.Clear;
qrytemp.SQL.Add('select * from PubDBGridStyle where PubLoginUser='''+strThreadUser+''' and PubTableName='''+strThreadTableName+''' and PubColVisible=1 order by PubDisSN ASC');
qrytemp.Open;
qrytemp.First;
FormMain.DBGrid.Selected.begin
Update;
FormMain.DBGrid.Selected.Clear;
for inti:=0 to qrytemp.RecordCount-1do
begin
FormMain.DBGrid.Selected.Add(qrytemp.FieldByName('PubKeyName').AsString+#9+
qrytemp.FieldByName('PubDisWidth').AsString+#9+
qrytemp.FieldByName('PubDisName').AsString);
qrytemp.Next;
end;
FormMain.DBGrid.Selected.EndUpdate;
//SetDBGridControlType(FormMain.DBGrid);
finally
qrytemp.Free;
end;
end;
procedure myThread.Execute;
begin
{ Place thread code here }
try
CoInitialize(nil);
DisplayMessage;
LoadGridColumn;
FormMain.DBGrid.DataSource:=DataForm.DataSource;
FormMain.DBGrid.DataSource.DataSet.DisableControls;
case FormMain.IntFormFlag of
1: begin
//FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCorp.Close;
DataForm.ADOQueryCorp.SQL.Clear;
DataForm.ADOQueryCorp.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCorp.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
2: begin
//FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCountry.Close;
DataForm.ADOQueryCountry.SQL.Clear;
DataForm.ADOQueryCountry.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCountry.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
3: begin
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryProvince.Close;
DataForm.ADOQueryProvince.SQL.Clear;
DataForm.ADOQueryProvince.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryProvince.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
4: begin
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCity.Close;
DataForm.ADOQueryCity.SQL.Clear;
DataForm.ADOQueryCity.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCity.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
5: begin
//港口
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryPort.Close;
DataForm.ADOQueryPort.SQL.Clear;
DataForm.ADOQueryPort.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryPort.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
6: begin
//航线
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQuerySeaLine.Close;
DataForm.ADOQuerySeaLine.SQL.Clear;
DataForm.ADOQuerySeaLine.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQuerySeaLine.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
7: begin
//船舶
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryBoat.Close;
DataForm.ADOQueryBoat.SQL.Clear;
DataForm.ADOQueryBoat.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryBoat.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
8: begin
//包装类型
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryPackType.Close;
DataForm.ADOQueryPackType.SQL.Clear;
DataForm.ADOQueryPackType.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryPackType.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
9: begin
//集装箱型号
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCntSize.Close;
DataForm.ADOQueryCntSize.SQL.Clear;
DataForm.ADOQueryCntSize.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCntSize.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
10: begin
//运输条款
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryTrafficTerm.Close;
DataForm.ADOQueryTrafficTerm.SQL.Clear;
DataForm.ADOQueryTrafficTerm.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryTrafficTerm.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
11: begin
//贸易方式
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryTradeMode.Close;
DataForm.ADOQueryTradeMode.SQL.Clear;
DataForm.ADOQueryTradeMode.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryTradeMode.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
12: begin
//报关方式
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCustMode.Close;
DataForm.ADOQueryCustMode.SQL.Clear;
DataForm.ADOQueryCustMode.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCustMode.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
13: begin
//报关状态
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCustStatus.Close;
DataForm.ADOQueryCustStatus.SQL.Clear;
DataForm.ADOQueryCustStatus.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCustStatus.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
14: begin
//退关状态
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCustBack.Close;
DataForm.ADOQueryCustBack.SQL.Clear;
DataForm.ADOQueryCustBack.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCustBack.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
15: begin
//货币种类
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryCurr.Close;
DataForm.ADOQueryCurr.SQL.Clear;
DataForm.ADOQueryCurr.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryCurr.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
16: begin
//动态汇率
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryRate.Close;
DataForm.ADOQueryRate.SQL.Clear;
DataForm.ADOQueryRate.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryRate.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
17: begin
//费收项目
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryFeeItem.Close;
DataForm.ADOQueryFeeItem.SQL.Clear;
DataForm.ADOQueryFeeItem.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryFeeItem.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
18: begin
//简单费用分类
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQuerySFClass.Close;
DataForm.ADOQuerySFClass.SQL.Clear;
DataForm.ADOQuerySFClass.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQuerySFClass.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
19: begin
//银行帐户
// FormMain.DBGrid.DataSource:=DataForm.DataSource;
DataForm.ADOQueryAccount.Close;
DataForm.ADOQueryAccount.SQL.Clear;
DataForm.ADOQueryAccount.SQL.Add(FormMain.strPubSQL);
try
DataForm.ADOQueryAccount.Open;
Synchronize(HookUpUI);
finally
QueryError;
end;
end;
end;
ClearMessage;
CoUninitialize;
finally
FormMain.DBGrid.DataSource.DataSet.EnableControls;
end;
end;
procedure myThread.HookUpUI;
begin
case FormMain.IntFormFlag of
1: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCorp;
end;
2: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCountry;
end;
3: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceProvince;
end;
4: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCity;
end;
5: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourcePort;
end;
6: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceSeaLine;
end;
7: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceBoat;
end;
8: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourcePackType;
end;
9: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCntSize;
end;
10: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceTrafficTerm;
end;
11: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceTradeMode;
end;
12: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCustMode;
end;
13: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCustStatus;
end;
14: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCustBack;
end;
15: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceCurr;
end;
16: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceRate;
end;
17: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceFeeItem;
end;
18: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceSFClass;
end;
19: begin
FormMain.DBGrid.DataSource:=DataForm.DataSourceAccount;
end;
end;
end;
procedure myThread.QueryError;
begin
end;
procedure myThread.DisplayMessage;
begin
with FormMaindo
StatusBar.Panels[0].Text:='数据下载中,请梢后......';
end;
procedure myThread.ClearMessage;
begin
with FormMaindo
StatusBar.Panels[0].Text:='';
end;
end.
主界面上的一个DBGRID来连接动态连接ADOQUERY
但是,有的时候会出错,提示‘LIST INDEX OUT OF BOUND (2)’,我用的是IP4000里面的WWDBGRID,显示的列,我是动态加载数据库的。(有一个表专门存显示列名,列宽度)