dim rs As ADODB.Recordset
...
...
...
capture_id = rs.Fields(0)
what does .Fields(0) mean?
dim rs As ADODB.Recordset
...
...
...
capture_id = rs.Fields(0)
what does .Fields(0) mean?
It's pulling the first column from the current row in the result set.
Fields(x)
lets you access fields by a numerical index starting at 0.
Edit:
Example:
If the result set has two columns: foo
and bar
..
rs.Fields(0)
would return the value of column foo
,
and
rs.Fields(1)
would return the value of column bar
.
the first column from the recordset (0) is the first (1) is the second etc etc
example, if this is your query
select LastName, FirstName
from YourTable
In this case s.Fields(0) would return column LastName and rs.Fields(1) would return column FirstName
I would NEVER, EVER use this syntax. This depends on the query always having the same field in the first position.
Furthermore this would only savea a minute amount of time. (As in milliseconds if not less.)
Please. for the love of God, err proper programming practice, change that to use the field name. This almost, but not quite, belongs on the www.dailywtf.com website.