Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. using recordset in MS Access to place values into array

using recordset in MS Access to place values into array

Scheduled Pinned Locked Moved Visual Basic
databasedata-structuresquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    reegan41
    wrote on last edited by
    #1

    I have a string array. I want to run a query that will pull numerous paragraphs from a database. the query works fine. I usually use string = rs.GetString, and then split the string on Chr(13) into a string array so I can loop through and place each array memeber into a combobox or listbox. however, in this situation, there is no distinct delimiter to split on. I was wondering, if I use recordset.GetRows, use that in a loop...if I could then use some property/sub routine within recordset so that I can place each result in a specific element in my array manually using a loop. Right now I have the following: 'all definitions aside' rs.Open LSQL, cnn rowCount = rs.GetRows For i = 0 To i < rowcount paragraphArray(i) = rs.????? I want to put basically the first recordset result into paragraphArray(0), second into paragraphArray(1), and so on until the recordset is at the end. I'm not sure of the exact code to use. Any ideas?

    G 1 Reply Last reply
    0
    • R reegan41

      I have a string array. I want to run a query that will pull numerous paragraphs from a database. the query works fine. I usually use string = rs.GetString, and then split the string on Chr(13) into a string array so I can loop through and place each array memeber into a combobox or listbox. however, in this situation, there is no distinct delimiter to split on. I was wondering, if I use recordset.GetRows, use that in a loop...if I could then use some property/sub routine within recordset so that I can place each result in a specific element in my array manually using a loop. Right now I have the following: 'all definitions aside' rs.Open LSQL, cnn rowCount = rs.GetRows For i = 0 To i < rowcount paragraphArray(i) = rs.????? I want to put basically the first recordset result into paragraphArray(0), second into paragraphArray(1), and so on until the recordset is at the end. I'm not sure of the exact code to use. Any ideas?

      G Offline
      G Offline
      GoodID
      wrote on last edited by
      #2

      Hi reegan41, I think you should store all fields value from recordset into string variable. You can do this by read all fields with For Each Statement. GoodID

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups