码迷,mamicode.com
首页 > Windows程序 > 详细

Delphi 获取临时数据集 ClientDataSet

时间:2019-02-03 19:38:13      阅读:284      评论:0      收藏:0      [点我收藏+]

标签:pen   The   open   stat   ecs   nil   order   finally   field   

function GetcdsAccountsData: OleVariant;
  var ASQLQuery: TSQLQuery;
      Adsp: TProvider;
  begin
    ASQLQuery:=CreateSQLQuery;
    Adsp:=TProvider.Create(nil);
    with ASQLQuery do try
      SQL.Add(Select AccID, pAccID, AccName, AccFullName, Explan, Grade, Property, Detailed, DC, SublegType);
      SQL.Add(,DeptAcc, EmplAcc, CorpAcc, ItemAcc, pItemID, Fcy, FcyNo, FcyExrate);
      SQL.Add(,Qty, QtyUnit, QtySpecs, QtyPrice,QDigits, PDigits, FDigits);
      SQL.Add(from Accounts);
      SQL.Add(where SysID=:SysID and Status=‘‘A‘‘);
      SQL.Add(and accYear=:accYear);
      SQL.Add(Order by AccID);
      ParamByName(SysID).AsInteger:=FSysID;
      ParamByName(accYear).AsInteger:=FLoginDate.Year;
      Adsp.DataSet:=ASQLQuery;
      Result:=Adsp.Data;
    finally
      Adsp.Free;
      Free;
    end;
  end;

  function CheckOpencdsAccounts: Boolean;
  begin
    if FcdsAccounts=nil then
      FcdsAccounts:=TClientDataSet.Create(Self);
    with FcdsAccounts do begin
      if not Active then begin
        Data:=GetcdsAccountsData;
        IndexFieldNames:=AccID;
      end;
      Result:=Active;
    end;
  end;

 

Delphi 获取临时数据集 ClientDataSet

标签:pen   The   open   stat   ecs   nil   order   finally   field   

原文地址:https://www.cnblogs.com/jijm123/p/10350846.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!