executing a query from pgm and getting less than total nbr of reco

A

Acie

Hi,

I'm creating a query from the code, and then i execute this query from the
code, but I'm only getting 593 records out of 14,000 records. Yet , if I go
to the query in MS Access '02 (outside the code), I execute the created query
and I get the 14,000.

Any explanation ? I'm using DAO3.6

sample code below:
Set qdf = dbs.CreateQueryDef("bb_temp_equity", sql)
Set rst = qdf.OpenRecordset()

vardata = Null

found_data = False
If Not rst.BOF And Not rst.EOF Then
vardata = rst.GetRows(50000)
found_data = True
End If
rst.Close

if found_data then
For k = 0 To UBound(vardata, 2)
....
end if
 
C

Chris O'C via AccessMonster.com

Use these commands to populate the recordset with all rows before using
GetRows:

rst.MoveLast
rst.MoveFirst

Whatever you're doing with the array can probably be done faster and more
efficiently with a query, especially since you're looping through every row.

Chris
Microsoft MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top