Can someone tell me when a recordset will return 'nothing' and when a recordset will return no record (i.e. both BOF and EOF are true)? It appears for some of my procedures the recordsets return NOTHING sometimes and for some other routines they returns BOF and EOF. To avoid the confusion, I use the routine as follow:
...
dim rs as adodb.recordset
set rs = createobject("ADODB.recordset")
...
rs.open mySQLstatement, adoConn
..
If not rs is nothing then
do while not (rs.eof or rs.bof)
xxx
xxx
loop
else
err.raise xxxxxx
end if
It is OK but I find it a little bit too cumbersome. Is there a better way to handle it?
Thanks in advance,
Wai-man
Try this...
...
dim rs as adodb.recordset
set rs = createobject("ADODB.record
...
rs.open mySQLstatement, adoConn
...
while not rs.eof
xxx
xxx
rs.MoveNext
loop