Consulting

Results 1 to 10 of 10

Thread: Take elements from database table to array using VBA

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Take elements from database table to array using VBA

    Hi in order to do that I use this code
    Sub test()
    Dim rstData As DAO.Recordset
    Dim a1 As Variant
    Set rstData = CurrentDb.OpenRecordset("select value_a from Population")
    rstData.MoveLast
    rstData.MoveFirst
    a1 = rstData.GetRows(rstData.RecordCount)
    Debug.Print Join(a1, " ")
    End Sub
    But I get error Invalid Procedure call or argument.
    Whta's wrong with my code?
    EDIT1 Seems this code gives two dementional array, kinda a1(0, 0)
    Is it possible to get one dementional array straight away? Without looping
    Attached Images Attached Images

Posting Permissions

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