Results 1 to 3 of 3

Thread: Database to Array? HELP

  1. #1
    Guest

    Talking

    I am having trouble transfering data from a table in a database to an array in my program?

    Help

  2. #2
    Lively Member
    Join Date
    Jul 2000
    Location
    Stockholm, Sweden
    Posts
    83
    You are not that specific about you problem. Is this that you are looking for ?

    Code:
        Do Until rsTmp.EOF
            For lngY = 0 To rsTmp.Fields.Count - 1
                YouArray( lngX, lngY ) = rsTmp.Fields(lngT).Value
            Next lngY
            rsTmp.MoveNext
            lngX = lngX + 1 
        Loop
    Yesterday, all my troubles seemed so far away...
    Help, I need somebody, Help...
    Now MCSD and still locking for intresting job in the south parts of Stockholm, Sweden.

  3. #3
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Cool Maybe or not...

    Public classinfoarray as string(or variant if not all the same)

    ReDim ClassInfoArray(1 To 3, 1 To rst.RecordCount)

    Dim i As Integer

    For i = 1 To rst.RecordCount

    ClassInfoArray(1, i) = rst!Class
    ClassInfoArray(2, i) = rst!Department
    ClassInfoArray(3, i) = rst!IDNumber

    rst.MoveNext

    Next i

    this loads all values of three feilds into the array. the reason I used public was to keep the values for the length of the project (assuming that you will need them).

    Good luck.
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

Posting Permissions

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



Click Here to Expand Forum to Full Width