Dim STR
Dim i, j As Integer
Dim Arry'定义数组
Dim Rs As ADODB.Recordset
Dim CN As ADODB.Connection
Set CN = New ADODB.Connection
STR = "...“
CN.Open "连接字符串"
Set Rs = New ADODB.Recordset
Rs.Open STR, CN, adOpenStatic, adLockReadOnly
ReDim Arry(1 To Rs.RecordCount, 1 To Rs.Fields.Count)’根据数据大小重新定义数组
For j = 1 To Rs.RecordCount
For i= 1 to Rs.Fields.Count
Arry(j, i) = Rs.Fields(i-1)
Next i
Rs.MoveNext
Next j