i am focusing on a MS access database..
Sooner or later i desired to produce a module which consists of an engaged string array, the information to keep within this array ought to be introduced from the table, i personally use count(*) function on that table to define how big the dynamic array.
what i have to know is how you can fill the array using the items in a posts of this table ( known as Names)
to really make it more obvious: suppose i declared the array such as this
dim myArray() as string redim myArray(myTable.count(*))
where my table consists of two fields: ID, Title
i would like myArray() to carry this content of Title within the first record myArray(1) to carry this content of Title within the second record
and so forth
how to get this done?
I don't know why you would like to make use of an array, but this is a way modified from the Microsoft article:
Dim objConnection as ADODB.Connection Dim objRecordSet as ADODB.Recordset Dim arrTest as variant Set objConnection = CurrentProject.Connection Set objRecordSet = New ADODB.Recordset objRecordSet.Open "SELECT * FROM YourTable" , objConnection, _ adOpenStatic, adLockOptimistic arrTest = objRecordSet.GetRows objRecordSet.Close objConnection.Close