Loop through Recordset


/ Published in: Visual Basic
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Dim sql As String
  2. Dim rstRecordset As recordset
  3.  
  4. sql = "SELECT * FROM xxx;"
  5. Set rstRecordset = CurrentDb.OpenRecordset(sql, dbOpenSnapshot)
  6.  
  7. If rstRecordset.RecordCount > 0 Then
  8. rstRecordset.MoveFirst
  9.  
  10. Do While Not rstRecordset.EOF
  11. 'Access values with rstRecordset(0), rstRecordset(1), etc.
  12. rstRecordset.MoveNext
  13. Loop
  14. End If

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.