Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    1

    Unanswered: How to access items of recordset

    Hi,

    this is my source code in VBA in access

    Dim Databaza As DAO.Database
    Dim ZdrojSQL As DAO.Recordset
    Dim SelectSQL As String

    SelectSQL = "SELECT * FROM SeznamTemp"

    Set Databaza = CurrentDb()

    Set ZdrojSQL = Databaza.OpenRecordset(SelectSQL)[/I]

    Result of that SQL command should be 142 rows and 12 columns... I would like to know how can I access those rows and columns. For example I wanna data from 15th row and 8th column. Is it somehow possible how to get it from recordset? Or could you advice me how to do that in another way?

  2. #2
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Dim ZdrojSQL As DAO.Recordset
    Dim WantedData as Whatever
    Dim i as Integer

    Set ZdrojSQL = CurrentDb.OpenRecordset("SELECT * FROM SeznamTemp")

    Do Until rs.EOF
    i=i+1
    If i=15 Then
    WantedData=rs(7)
    Exit Do
    EndIf
    rs.MoveNext
    Loop

    rs.Close
    Set rs=Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •