


I don't currently have a VB6 installation to test, but if I remember well, you can use the recordset's EOF property to control a loop to read all the rows in the recordset.
Something like this:
<pre>Call dbConnect
SQL = "SELECT Grade, Sum(Currentweight) as GradePR1 FROM Weighroom WHERE (currentdate = DateValue(Now) and Roomno = '01') Group by Grade"
rs.Open SQL, Conn
<b>if rs.BOF and rs.EOF then
'do something, the recordset is empty
else
rs.MoveFirst
Do Until rs.EOF
'do something with the current record, the same way you are currently doing it
rs.MoveNext
Loop</b>
End If</pre>
I don’t currently have a VB6 installation to test, but if I remember well, you can use the recordset’s EOF property to control a loop to read all the rows in the recordset.
Something like this:
<pre>Call dbConnect
SQL = “SELECT Grade, Sum(Currentweight) as GradePR1 FROM Weighroom WHERE (currentdate = DateValue(Now) and Roomno = ’01′) Group by Grade”
rs.Open SQL, Conn
<b>if rs.BOF and rs.EOF then
‘do something, the recordset is empty
else
rs.MoveFirst
Do Until rstPublishers.EOF
‘do something with the current record, the same way you are currently doing it
rs.MoveNext
Loop</b>
End If</pre>


Carlosdl.. huge thankyou.. such a simpy thing to add and it works a treat..
Great.
I’m glad it was helpful.