I want to put the data returned from an SQL query to an array.
As far as I know I can get the data if it's only a single value like this:
Code:
Text1.text = rc.Fields("xyz")
But if there are more values returned it doesn't work because only the first value is shown in the text field.
Now, if I got a table called users and I want to know the names of all users who have blue hair I would try this:
Code:
Dim db As Database
Dim rs As Recordset, SQL$
Set db = OpenDatabase("C:\My Documents\mytestdb.mdb")
SQL = "SELECT username FROM users where haircolor like ""blue"""
Set rs = db.OpenRecordset(SQL)
But how can I put the names returned (and the other stuff) to an array like this:
Code:
Type TUser
     username as String
     haircolor as String
     password as String
End Type
Dim userlist() as TUser