View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default Questions about ADO

Where rst is your recordset.

1. rst.RecordCount
-or-
you could do a query first to determine the number of rows which will
return.
select count(*) from my_table

2. rst.Fields.Count

ADO Programmers Reference:
http://msdn.microsoft.com/library/en...ireference.asp


--
Rob van Gelder - http://www.vangelder.co.nz/excel


wrote in message news:asYGd.18123$B95.5622@lakeread02...
All -

Working the issue of a large data import, Google led me to ADO. I have
the basic routine working, copyied from a European website.

Right now I determine the size of the import afterwards via xlend etc.
Is there a property I can access before the import (rs.recordcount or
somesuch) that will tell me what the number of records is beforehand so
I can size the copied data? Easy enough for me to do except when I want
all of them. Second question--same for number of fields.

Right now, I count field.names while field(i).name < vbnullstring.
That gives an error, for which I continue on, and capture my counter. A
method that grates. What are the values of "empty" field.names? NULL
doesn't work either.


Thanks in advance.

...best, Hash