ado recordset recordcount - out of memory error

ado recordset recordcount - out of memory error

Post by cGdz » Wed, 12 Aug 2009 05:40:01


I am working with several tables and I am getting an 'Out of Memory' error
when I execute the following line of code:

Label1.Caption = "Total Records: " & Adodc1.Recordset.RecordCount

I am working with an Oracle DB

Is there a size limit with the Recordset.RecordCount?
I know this table is very large about 30,000,000 records
All I wanted was to get the number of records in the table?

--
pgs
 
 
 

ado recordset recordcount - out of memory error

Post by Schmid » Wed, 12 Aug 2009 06:35:57


"pgs" < XXXX@XXXXX.COM > schrieb im Newsbeitrag


Change the above line to:
Set RsTmp = Cnn.Execute("Select Count(*) From [" & TblName & "]")
Label1.Caption = "Total Records: " & RsTmp.Fields(0).Value
RsTmp.Close

This returns only a temporary Recordset with only one single
Record (containing only one single Field with the desired result).
It does not try to fill-up an entire Rs-Memory-Representation
of your 30Mio records-table, only to get the "row-count".

Olaf

 
 
 

ado recordset recordcount - out of memory error

Post by Mike » Wed, 12 Aug 2009 06:47:55


I've never used the data control (the intrinsic DAO one or the ADO one), so
I can't really answer your question. But I can offer an alternative that
would most likely be much better.

Execute a simple SQL query such as this:

SELECT COUNT(*) AS NUMROWS FROM <TableName>


--
Mike
 
 
 

ado recordset recordcount - out of memory error

Post by cGdz » Fri, 14 Aug 2009 01:14:01

thank you -
Also, do you happen to know what the size limits are to the Data Controls?
--
pgs
 
 
 

ado recordset recordcount - out of memory error

Post by Nobod » Fri, 14 Aug 2009 01:20:39


Probably 2 billion records, but you are most likely to run out of memory
before then.