Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rs.RecordCount always -1

Status
Not open for further replies.

GerardMcL

Technical User
Aug 5, 2004
212
IE
Hi,

I am trying to export to a txt file. First fill a recordSet with required data - stick it in an array and print array to txt file.

But when I try to ReDim my array

ReDim array(7, strRecordSet.RecordCount)

RecordCount always = -1

Am I using this in the wrong way? Do I just need to do a COUNT statement and find length that way?

I know for sure there are records returned into this recordset.
 
ADO Record Count is dependant on cursor location etc.
See thread222-889231 for illustration.

HTH

TazUk

[pc] Blue-screening PCs since 1998
 
If you do a MoveLast it will populate the recordset and give you the number of records. You will need a check to make sure records exist first (not BOF or EOF).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top