L
Larruping
Unregistered / Unconfirmed
GUEST, unregistred user!
TMergerOrder = class
private
FOrderNoList: TStringList;
FADOQryCommon: TADOQuery;
FNewOrderNo: Integer;
function GetNewOrderNo: Integer;
function CheckData: Boolean;
public
constructor Create(OrderNoList: TStringList);
destructor Destroy
override;
function doMerger(var ErrorMsg: string): boolean;
property NewOrderNo: Integer read FNewOrderNo;
end;
constructor TMergerOrder.Create(OrderNoList: TStringList);
begin
inherited Create;
FOrderNoList := OrderNoList
//这里出错
FADOQryCommon := TADOQuery.Create(nil)
//注释掉上一句,这里也会出错
FADOQryCommon.Connection := dmConn.AdoCn;
end;
destructor TMergerOrder.Destroy;
begin
inherited;
if Assigned(FOrderNoList) then
FOrderNoList.Free;
if FADOQryCommon <> nil then
begin
FADOQryCommon.Close;
FADOQryCommon.Free;
end;
end;
private
FOrderNoList: TStringList;
FADOQryCommon: TADOQuery;
FNewOrderNo: Integer;
function GetNewOrderNo: Integer;
function CheckData: Boolean;
public
constructor Create(OrderNoList: TStringList);
destructor Destroy
override;
function doMerger(var ErrorMsg: string): boolean;
property NewOrderNo: Integer read FNewOrderNo;
end;
constructor TMergerOrder.Create(OrderNoList: TStringList);
begin
inherited Create;
FOrderNoList := OrderNoList
//这里出错
FADOQryCommon := TADOQuery.Create(nil)
//注释掉上一句,这里也会出错
FADOQryCommon.Connection := dmConn.AdoCn;
end;
destructor TMergerOrder.Destroy;
begin
inherited;
if Assigned(FOrderNoList) then
FOrderNoList.Free;
if FADOQryCommon <> nil then
begin
FADOQryCommon.Close;
FADOQryCommon.Free;
end;
end;