I'm pulling data from SQL databases using OLEDB.
I can return the data (without headers) by using
avarResult = rst.GetRows()
or
I can return the headers only by using
Set rst = cnn.OpenSchema(adSchemaColumns, Array(Empty, Empty, strTableName))
lngCnt = 0
Do While Not rst.EOF
lngCnt = lngCnt + 1
ReDim Preserve varResult(1 To lngCnt)
varResult(lngCnt) = rst("COLUMN_NAME")
rst.MoveNext
Loop
How can I return the data with its headers using the same recordset? (I'm joining the two arrays from above but it's inefficient. I want to do this in one operation.)
Bookmarks