--- connection.c.old 2005-09-14 22:55:05.000000000 -0400 +++ connection.c 2005-09-14 22:13:31.000000000 -0400 @@ -3244,6 +3244,11 @@ PQclear(pgres); return qres; } + + if (PQresultStatus(pgres) == PGRES_TUPLES_OK) + { + qres->ntuples = PQntuples(pgres); + } qres=CC_mapping(self,pgres,qres); QR_set_command(qres, query); --- qresult.h.old 2005-09-14 22:57:12.000000000 -0400 +++ qresult.h 2005-09-14 22:12:20.000000000 -0400 @@ -69,6 +69,7 @@ #ifdef USE_LIBPQ ExecStatusType status; + int ntuples; #else QueryResultCode status; #endif /* USE_LIBPQ*/ --- qresult.c.old 2005-09-14 22:57:07.000000000 -0400 +++ qresult.c 2005-09-14 22:13:01.000000000 -0400 @@ -135,6 +135,9 @@ rv->dl_alloc = 0; rv->dl_count = 0; rv->deleted = NULL; +#ifdef USE_LIBPQ + rv->ntuples = 0; +#endif } mylog("exit QR_Constructor\n"); --- results.c.old 2005-09-14 22:57:16.000000000 -0400 +++ results.c 2005-09-14 22:59:47.000000000 -0400 @@ -74,6 +74,13 @@ } if (res->recent_processed_row_count >= 0) { +#ifndef USE_LIBPQ + if (res->recent_processed_row_count = 0 && res->ntuples > 0) + { + *pcrow = res->ntuples; + return SQL_SUCCESS; + } +#endif *pcrow = res->recent_processed_row_count; mylog("**** PGAPI_RowCount(): THE ROWS: *pcrow = %d\n", *pcrow);