vb把数据库里的数据导入数组

2025-01-06 11:28:01
推荐回答(1个)
回答1:

If RS.RecordCount > 0 Then
i = Rs.RecordCount - 1 '获取记录数

j = Rs.Fields.Count - 1 ‘获取字段数
ReDim A(i, j)
rs.movefirst
For m = 0 To i
For n = 0 To j
A(m, n) = Rs.Fields(n)

Next n
RS.MoveNext
Next m

End If
大体就是这样