You can try to do it in the query, if you're working directly with the database (no recordset manipulation) you can look for the database's engine implementation of that, or if you're manipulating the recordset you can use a column and update with an incremental value (not sure if this will work, i haven't try it myself)
Hope this helps,
David.