Hello,
I would like to create an array that is populated with the items found in a column in a database.
Say if in my data base I have a table called names and in that table I have a column called First names that is contains well....first names. I would like to create an array that contains the names in that column
This is what I have so far:
I have no idea if I am going about it right but that is what I have dug up so far.
Eventually I want to use the names to build a SQL string... but I first need to get the names in some sort of list.... I think...
I would like to create an array that is populated with the items found in a column in a database.
Say if in my data base I have a table called names and in that table I have a column called First names that is contains well....first names. I would like to create an array that contains the names in that column
This is what I have so far:
Code:
Dim db As DAO.Database
Dim ws As DAO.Workspace
Dim rs As DAO.Recordset
Dim fnames() As String
Dim RecCnt As Integer
Dim Max As Integer
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase("Path to the database")
Set rs = db.OpenRecordset("Select FirstNames From Names")
Max = rs.RecordCount
ReDim lcsfields(1 To Max)
For RC = 1 To Max
lcsfields = lcsfields & ????
Next RC
.....
I have no idea if I am going about it right but that is what I have dug up so far.
Eventually I want to use the names to build a SQL string... but I first need to get the names in some sort of list.... I think...