失
失败者
Unregistered / Unconfirmed
GUEST, unregistred user!
unit ttd;
interface
uses
SysUtils, Classes, DB, ADODB;
type
TdmDataManage = class(TDataModule)
adqDataManage: TADOQuery;
dsDataManage: TDataSource;
private
protected
procedure SetSQL(const sSQl:TStrings);
function GetSQL(const Fieldname: String):TStrings;
public
procedure AddData(const Fieldcost : array of const);
procedure EditData(const Fieldname: array of string
const Fieldcost:array of string);
procedure DelData;
property mSQL: TStrings read GetSQL write SetSQl;//此处提示类型不一致
end;
var
dmDataManage: TdmDataManage;
implementation
{$R *.dfm}
{ TdmDataManage }
function TdmDataManage.GetSQL(const Fieldname: String): TStrings;
var
m : TStringList;
begin
m:=TStringList.Create;
dsDataManage.DataSet.First;
while Not dsDataManage.DataSet.Eof do
begin
m.Add(dsDataManage.DataSet.FieldValues[Fieldname]);
dsDataManage.DataSet.Next;
end;
result:=m;
end;
procedure TdmDataManage.SetSQL(const sSQl: TStrings);
begin
adqDataManage.Close;
adqDataManage.SQL.Clear;
adqDataManage.SQL.AddStrings(sSQL);
adqDataManage.Open;
dsDataManage.DataSet.Refresh;
end;
end.
请问是那的错误?我把TdmDataManage.GetSQL(const Fieldname: String): TStrings;
中的Fieldname的类型改成TStrings也不行,还是说类型错,谢谢
interface
uses
SysUtils, Classes, DB, ADODB;
type
TdmDataManage = class(TDataModule)
adqDataManage: TADOQuery;
dsDataManage: TDataSource;
private
protected
procedure SetSQL(const sSQl:TStrings);
function GetSQL(const Fieldname: String):TStrings;
public
procedure AddData(const Fieldcost : array of const);
procedure EditData(const Fieldname: array of string
const Fieldcost:array of string);
procedure DelData;
property mSQL: TStrings read GetSQL write SetSQl;//此处提示类型不一致
end;
var
dmDataManage: TdmDataManage;
implementation
{$R *.dfm}
{ TdmDataManage }
function TdmDataManage.GetSQL(const Fieldname: String): TStrings;
var
m : TStringList;
begin
m:=TStringList.Create;
dsDataManage.DataSet.First;
while Not dsDataManage.DataSet.Eof do
begin
m.Add(dsDataManage.DataSet.FieldValues[Fieldname]);
dsDataManage.DataSet.Next;
end;
result:=m;
end;
procedure TdmDataManage.SetSQL(const sSQl: TStrings);
begin
adqDataManage.Close;
adqDataManage.SQL.Clear;
adqDataManage.SQL.AddStrings(sSQL);
adqDataManage.Open;
dsDataManage.DataSet.Refresh;
end;
end.
请问是那的错误?我把TdmDataManage.GetSQL(const Fieldname: String): TStrings;
中的Fieldname的类型改成TStrings也不行,还是说类型错,谢谢