The SQL_GetNumCols() function returns the number of columns in the current results set for the specified pass-through SQL connection.
SQL_GetNumCols(SQL_connection, num_columns)
• SQL_connection – A long integer specifying the pass-through SQL connection to use.
• num_columns – A returned long integer containing the number of columns in the current results set.
A long integer indicating whether the operation was successful. The value 0 indicates the number of columns was successfully retrieved. Any other value indicates an error occurred.