firemonkey
06-19-2013, 04:06 AM
I am trying to fill an array with data from a table in access and keep getting a type mismatch even though it is defined as a variant. (See below) I would appreciate some assist here as I cannot see what the issue is??
I know it is picking up the first row in the table because if you remove the '0' from '(0)' the code errors but the first string of data is displayed.
___
Dim dbsDB As DAO.Database
Dim rstTable As DAO.Recordset
Dim arrARRAY() as variant
Dim intRow As Integer
intRow = 0
Set dbsDB = CurrentDb
Set rstTable = dbsDB.OpenRecordset("Table")
rstTable.MoveFirst
Do Until rstTable.EOF
arrARRAY(intRow) = rstTable!Field(0):dunno
rstTable.MoveNext
intRow = 0 + 1
Loop
rstTable.Close
Set rstTable = Nothing
dbsDB.Close
Set dbsDB = Nothing
______
I know it is picking up the first row in the table because if you remove the '0' from '(0)' the code errors but the first string of data is displayed.
___
Dim dbsDB As DAO.Database
Dim rstTable As DAO.Recordset
Dim arrARRAY() as variant
Dim intRow As Integer
intRow = 0
Set dbsDB = CurrentDb
Set rstTable = dbsDB.OpenRecordset("Table")
rstTable.MoveFirst
Do Until rstTable.EOF
arrARRAY(intRow) = rstTable!Field(0):dunno
rstTable.MoveNext
intRow = 0 + 1
Loop
rstTable.Close
Set rstTable = Nothing
dbsDB.Close
Set dbsDB = Nothing
______