How to use BlkGet to fetch data from Sage 300 using COMAPI in VB6.0

By | November 30, 2020

In this blog, we will be looking on fetching the data from Sage 300 Views with BlkGet function using COMAPI in VB6.0. Sage 300 has many ways to read the records using CS0120 view by querying the database, opening and composing the Business Views. Reading of the data can be done one at a time using the Field Name or Field Index or getting the list of Field Values all together for the specified indexes.

The BlkGet method is effective as there is no need to read the single value at an instance of time and the whole set of values can be stored in an object at once.

New Stuff:  Quick Shipment feature for Sage 300 ERP Version 2020 Released

We will be looking into the steps to create a program of the same with a sample code of AR Customer.

Step 1: Include the Sage 300 COMAPI in the project.

Step 2: Once the Advantage DLL is included, create the object of the Session and initialize it.

Step 3: Create, Open and Compose Sage 300 Views.

Step 4:

  • Read the data using the index value (IDCUST in our example).
  • Fetch the data using BlkGet
BlkGet COMAPI in VB6.0

First parameter of BlkGet is for accepting the field index whose values are required.

Second parameter of BlkGet is an Array object which populates the field values at the same position as that of an Index Array.

Developer can include any number of field index in an Array that are required for performing a particular task.

The list of values fetch for particular set of condition is now available and stored in an Array for further processing.

About Us

Greytrix – a globally recognized and one of the oldest Sage Development Partner is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third party add-on development and implementation competence.

Greytrix offers unique GUMU™ integrated solutions of  Sage 300 with Sage CRM,, Dynamics 365 CRM and Magento eCommerce along with Sage 300 Migration from Sage 50 US, Sage 50 CA, Sage PRO, QuickBooks, Sage Business Vision and Sage Business Works. We also offer best-in-class Sage 300 customization and development services and integration services for applications such as POS | WMS | Payroll | Shipping System | Business Intelligence | eCommerce for Sage 300 ERP and for Sage 300c development services we offer, upgrades of older codes and screens to new web screens, latest integrations using sData and web services  to Sage business partners, end users and Sage PSG worldwide. Greytrix offers 20+ addons for Sage 300 to enhance productivity such as GreyMatrixDocument AttachmentDocument NumberingAuto-Bank ReconciliationPurchase Approval SystemThree way PO matchingBill of Lading and VAT for Middle East. The GUMU™ integration for Dynamics 365 CRM – Sage ERP is listed on Microsoft Appsource with easy implementation package.

For more details on Sage 300 and Sage 300c Services, please contact us at, We will like to hear from you.