5117 AE_NOT_DML

Advantage Error Guide

The call to AdsGetRecordCount for an SQL Statement is invalid if the statement is not either an UPDATE, INSERT, DELETE, or MERGE statement.