D
dlss
Unregistered / Unconfirmed
GUEST, unregistred user!
边的代码执行BitBtn1Click时出现"Variant is not an array"错误
unit utThread;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, DB, DBClient, MConnect, SConnect, Grids,
DBGrids;
type
TfmMain = class(TForm)
DBGrid1: TDBGrid;
SocketConnection1: TSocketConnection;
ClientDataSet1: TClientDataSet;
DataSource1: TDataSource;
BitBtn1: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure OpenTable();
end;
TopenData = class(TThread)
private
{ Private declarations }
protected
procedure Execute;
override;
end;
var
fmMain: TfmMain;
implementation
{$R *.dfm}
procedure TfmMain.OpenTable();
begin
ClientDataSet1.Active:=false;
ClientDataSet1.Active:=true;
end;
procedure TopenData.Execute;
begin
{ Place thread code here }
fmMain.OpenTable;
end;
procedure TfmMain.BitBtn1Click(Sender: TObject);
var
newThread:TopenData ;
begin
newThread:=TopenData.Create(false);
end;
end.
unit utThread;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, DB, DBClient, MConnect, SConnect, Grids,
DBGrids;
type
TfmMain = class(TForm)
DBGrid1: TDBGrid;
SocketConnection1: TSocketConnection;
ClientDataSet1: TClientDataSet;
DataSource1: TDataSource;
BitBtn1: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure OpenTable();
end;
TopenData = class(TThread)
private
{ Private declarations }
protected
procedure Execute;
override;
end;
var
fmMain: TfmMain;
implementation
{$R *.dfm}
procedure TfmMain.OpenTable();
begin
ClientDataSet1.Active:=false;
ClientDataSet1.Active:=true;
end;
procedure TopenData.Execute;
begin
{ Place thread code here }
fmMain.OpenTable;
end;
procedure TfmMain.BitBtn1Click(Sender: TObject);
var
newThread:TopenData ;
begin
newThread:=TopenData.Create(false);
end;
end.