PDA

Click to See Complete Forum and Search --> : Database to Array? HELP


Sep 12th, 2000, 11:06 PM
I am having trouble transfering data from a table in a database to an array in my program?

Help

AKA
Sep 13th, 2000, 12:34 AM
You are not that specific about you problem. Is this that you are looking for ?


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

James Stanich
Sep 14th, 2000, 09:04 AM
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.