From the RecordCount Property (ADO) Documentation:
“… The property returns -1 when ADO cannot determine the number of records or if the provider or cursor type does not support RecordCount.”
It could be better to use the EOF Property to check whether you still have records to process, since RecordCount will not always help you with that.
When the data source returns no records, the provider sets both the BOF and EOF properties to True, so you can use that to check if the recordset is really empty.
Discuss This Question: 2  Replies
if rs.state=1 then rs.close
rs.Open SQL, Conn, adOpenDynamic, adLockOptimistic
if Rs.eof=false then
cboitem.clear
while rs.eof=false
cboitem.add(rs(0))
rs.movenext
wend
if rs.state=1 then rs.close
end if