Quote:
> Help....
> I am using an Oracle database with version 2.573 of the ODBC driver
and on
> the open() statement I do:
> Open(AFX_DB_USE_DEFAULT_TYPE,"SELECT SUBID,COUNT(*) AS TOTAL FROM
TABLE1
> GROUP BY SUBID);
> and I get an error "Cannot use Keyset-driven cursor on join, with
distinct
> clause, union, intersect or minus or on read only result set".
> The result set is dynaset so it is not read only.
> So my question is how do I use COUNT(*) in a select statement for the
ODBC
> dirver with Oracle.
In the Oracle8 ODBC driver, you'll get a warning to this effect and
your cursor will automatically be changed to a static cursor. If you
ask explicitly for a static cursor to begin with, you should be fine in
the 2.5 driver.
Essentially, the problem here is that Oracle's ODBC drivers implement
keyset-driven cursors by relying on ROWID's. If the rows of your
resultset cannot be correlated with ROWID's (i.e. because they're the
result of an aggregating function like count()), the drivers can't give
you a keyset cursor.
Justin Cave
Sent via Deja.com
http://www.deja.com/