应用服务器的函数
function TEQIn.GetEQ(const aType, aDeptID, aEquipID, aSupplyCoID, aState,
  InDT1, InDT2, InST, OutDT1, OutDT2, OutST, InDept,
  ValidMK: WideString): OleVariant;var
  sCondition, cSelectFasten, cSelect: string;
begin
  cSelectFasten :=
    'select m.*, c.Corp lnk_MFAC,d.Dept lnk_InDept, E.Corp lnk_SupplyCo, '+
    '(select sum(debitsum) from fl_charge where payeetm>=''%s'' and Payeetm<=''%s'' and fl_charge.Chargeid=m.chargeid) lnk_Sum, '+
    '0.00 lnk_hc,''否'' lnk_Select from '+
    ' (select a.*, b.Equip lnk_Equip, b.Model lnk_Model, b.Spell from EQ_LIST a,'+
    '(select '+
    '  a1.EQUIPID, '+
    '  RTrim(b1.Equip)'+GPerson[qliPlus]+''':'''+GPerson[qliPlus]+'RTrim(a1.EQUIP) Equip, '+
    '  a1.MODEL, '+
    '  a1.SPELL '+
    ' from ST_Equip a1 '+
    'left outer join ST_Equip b1 on b1.EquipID='+GPerson[qliSubstr]+'(a1.EquipID,1,2)) b '+
    '  where %s a.EquipID=b.EquipID) m '+
    ' Left Outer join ST_Corp c on m.MFAC=c.CorpID '+
    ' Left Outer join ST_Dept D on m.InDept=D.DeptID '+
    ' Left Outer join ST_Corp E on m.SUPPLYCOID=E.CorpID';  cSelect :=
    'select m.*, c.Corp lnk_MFAC,d.Dept lnk_InDept, E.Corp lnk_SupplyCo, '+
    '0.00 lnk_Sum, '+
    '0.00 lnk_hc,''否'' lnk_Select from '+
    ' (select a.*, b.Equip lnk_Equip, b.Model lnk_Model, b.Spell from EQ_LIST a,'+
    '(select '+
    '  a1.EQUIPID, '+
    '  RTrim(b1.Equip)'+GPerson[qliPlus]+''':'''+GPerson[qliPlus]+'RTrim(a1.EQUIP) Equip, '+
    '  a1.MODEL, '+
    '  a1.SPELL '+
    ' from ST_Equip a1 '+
    'left outer join ST_Equip b1 on b1.EquipID='+GPerson[qliSubstr]+'(a1.EquipID,1,2)) b '+
    '  where %s a.EquipID=b.EquipID) m '+
    ' Left Outer join ST_Corp c on m.MFAC=c.CorpID '+
    ' Left Outer join ST_Dept D on m.InDept=D.DeptID '+
    ' Left Outer join ST_Corp E on m.SUPPLYCOID=E.CorpID';
  with qryUpEQList do
  begin
    Active := False;
    sCondition := '';
    if aEquipID <> '' then sCondition := sCondition + '(a.EquipID='''+aEquipID+''')and';
    if aSupplyCoID <> '' then sCondition := sCondition + '(a.SUPPLYCOID='''+aSupplyCoID+''')and';
    if aState <> '' then sCondition := sCondition + '(a.State='''+aState+''')and';
    if (InDT1 <> '')and(aType <> '扎帐') then sCondition := sCondition + '(a.InDate>='''+INDT1+''')and';
    if INDT2 <> '' then sCondition := sCondition + '(a.INDate<='''+INDT2+''')and';
    if INST <> '' then sCondition := sCondition + '(a.INST='''+INST+''')and';
    if OutST <> '' then sCondition := sCondition + '(a.OutST='''+OutST+''')and';
    if OutDT1 <> '' then sCondition := sCondition + '(a.OutDate>='''+OutDT1+''')and';
    if OutDT2 <> '' then sCondition := sCondition + '(a.OutDate<='''+OutDT2+''')and';
    if InDept <> '' then sCondition := sCondition + '(a.InDept='''+InDept+''')and';
    if ValidMK <> '' then sCondition := sCondition + '(a.ValidMK='''+ValidMK+''')and';
    if (aType = '初始') then
      SQL.Text := Format(cSelect, [sCondition])
    else
    if (aType = '扎帐') then
      SQL.Text := Format(cSelectFasten, [InDT1+' 00:00:00', InDT2+' 00:00:00', sCondition+'(a.State=''使用'' or a.State=''在库'')and'])
    else
    if (aType = '维修') then
    begin
      if aDeptID <> '' then
        SQL.Text := Format(cSelect, [sCondition+'a.State=''使用'' and a.InDEPT='''+aDeptID+''' and'])
      else
        SQL.Text := Format(cSelect, [sCondition+'(a.State=''使用'' or a.State=''出租'' or a.State=''在库'')and']);
    end
    else
    if (aType = '退库')or(aType = '') then
    begin
      if aDeptID <> '' then
        SQL.Text := Format(cSelect, [sCondition+'(a.State=''使用'' or a.State=''出租'')and(RegEqIONO is Null)and(InDEPT='''+aDeptID+''')and'])
      else
        SQL.Text := Format(cSelect, [sCondition+'(a.State=''使用'' or a.State=''出租'')and(RegEqIONO is Null)and']);
    end
    else
    if (aType = '领用')or
       (aType = '调出')or(aType = '出租') then
      SQL.Text := Format(cSelect, [sCondition+'(a.State in (''在库''))and(RegEqIONO is Null)and'])
    else
    if (aType = '退货')or(aType = '报废') then
      SQL.Text := Format(cSelect, [sCondition+'(a.State in(''在库'',''使用'',''出租''))and(RegEqIONO is Null)and']);
  end;end;
客服端的调用
  DM.DCOM.AppServer.GetEQ(
      '初始','','','','','','','','','','','','');
报错:Variant is not an array