Why don int4 based aggregates seem to work?
Some Aggregates such as sum(int4) and avg(int4) return results using the numeric datatype. This is perfectly legal according to the SQL spec and is done to prevent overflows and other problems, but unfortunately Microsoft’s ActiveX Data Objects don’t seem to like it. There are two workarounds: • Cast the result to an int4 e.g. SELECT avg(fieldname)::int4 FROM tablename • Set the ADO CursorLocation to AdUseClient. Note: This will produce a read only recordset.