我建议将记录集与DI API一起使用-
SAPbobsCOM.Rec或dset rs = ((SAPbobsCOM.Company)oCompany.GetDICompany()).GetBusinessObject(BoObjectTypes.B或ec或dset); rs.DoQuery("SELECT DocEntry, DocNum, DocDate, TaxDate, CardCode, CardName, DocTotal FROM OP或 或DER BY DocDate ASC"); while (!rs.EoF) { int DocEntry = rs.Fields.Item("DocEntry").Value; //或 DocEntry = rs.Fields.Item(0).Value; rs.MoveNext(); }