What does rs.Fields (0) mean? (ADODB) VBA
It pulls the first column from the current row in the result set.
Fields(x)
allows you to access fields using a numeric index starting at 0.
Edit
Example:
If the result set has two columns: foo
and bar
..
rs.Fields(0)
will return the column value foo
,
and
rs.Fields(1)
will return the column value bar
.
a source to share
I would never, ever use this syntax. It depends on the query always with the same field in the first position.
Moreover, it will only save a minute amount of time. (As in milliseconds, if not less.)
Please, for love of God, for correct programming practice, change this to use the field name. It almost, but not quite, belongs to the www.dailywtf.com website.
a source to share