hi,
i need to know how to count the number of rows in a DBgrid of
VB 5.0 or rows of a DataGrid in VB 6.0?
i know how many columns i have, but the number of the rows can change depending
on input.
please post code
-Michael L
Printable View
hi,
i need to know how to count the number of rows in a DBgrid of
VB 5.0 or rows of a DataGrid in VB 6.0?
i know how many columns i have, but the number of the rows can change depending
on input.
please post code
-Michael L
Since DBGrid and DataGrid are DataBound controls, they are attached to a datacontrol.
You can know the number of rows of your recordset with the RecordCount property,
it is the number of rows in your Grid.
Aleksandr
"Michael L" <mordy3eb@hotmail.com> wrote:
>
>hi,
>i need to know how to count the number of rows in a DBgrid of
>VB 5.0 or rows of a DataGrid in VB 6.0?
>
>i know how many columns i have, but the number of the rows can change depending
>on input.
>
>please post code
>
>-Michael L
Be carefule here. If you are using ADO the RecordCount property may sometimes
return -1... pretty cool huh! Yep you got some records!
If this occurs the only solution I've been able to come up with is looping
through the recordset until EOF and increment a counter.
HTH
Brent
"Aleksandr" <aleks@famcolorado.net> wrote:
>
>Since DBGrid and DataGrid are DataBound controls, they are attached to a
datacontrol.
>You can know the number of rows of your recordset with the RecordCount property,
>it is the number of rows in your Grid.
>
>Aleksandr
>
>"Michael L" <mordy3eb@hotmail.com> wrote:
>>
>>hi,
>>i need to know how to count the number of rows in a DBgrid of
>>VB 5.0 or rows of a DataGrid in VB 6.0?
>>
>>i know how many columns i have, but the number of the rows can change depending
>>on input.
>>
>>please post code
>>
>>-Michael L
>