失
失败者
Unregistered / Unconfirmed
GUEST, unregistred user!
unit ttd;
interface
uses
SysUtils, Classes, DB, ADODB;
type
TdmDataManage = class(TDataModule)
adqDataManage: TADOQuery;
dsDataManage: TDataSource;
private
{ Private declarations }
public
procedure AddData(const Fieldcost : array of const);
end;
var
dmDataManage: TdmDataManage;
implementation
{$R *.dfm}
{ TdmDataManage }
procedure TdmDataManage.AddData(const Fieldcost: array of const);
begin
dsDataManage.DataSet.AppendRecord(Fieldcost);
dsDataManage.DataSet.Refresh;
end;
unit tt;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ttd, Grids, DBGrids;
type
TForm1 = class(TForm)
DBGrid1: TDBGrid;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
DataManage : TdmDataManage;
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
DataManage:=TdmDataManage.Create(); 此处出错
DataManage.AddData(['A20-5','刘世龙','01-12-14','B2','1000','1000']);
DataManage.Free;
end;
end.
我想在unit tt中实例化unit ttd中的TdmDataManage,但编译时系统提示我缺少Tcomponent类型的参数,请问我应该如何做?谢谢
咦我怎么没分了还应该有200多分才对呀?
interface
uses
SysUtils, Classes, DB, ADODB;
type
TdmDataManage = class(TDataModule)
adqDataManage: TADOQuery;
dsDataManage: TDataSource;
private
{ Private declarations }
public
procedure AddData(const Fieldcost : array of const);
end;
var
dmDataManage: TdmDataManage;
implementation
{$R *.dfm}
{ TdmDataManage }
procedure TdmDataManage.AddData(const Fieldcost: array of const);
begin
dsDataManage.DataSet.AppendRecord(Fieldcost);
dsDataManage.DataSet.Refresh;
end;
unit tt;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ttd, Grids, DBGrids;
type
TForm1 = class(TForm)
DBGrid1: TDBGrid;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
DataManage : TdmDataManage;
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
DataManage:=TdmDataManage.Create(); 此处出错
DataManage.AddData(['A20-5','刘世龙','01-12-14','B2','1000','1000']);
DataManage.Free;
end;
end.
我想在unit tt中实例化unit ttd中的TdmDataManage,但编译时系统提示我缺少Tcomponent类型的参数,请问我应该如何做?谢谢
咦我怎么没分了还应该有200多分才对呀?