Access 2010 VBA 读取 表中的数据

Option Compare Database

Private Sub Command0_Click()
    Dim db
    Dim rs As Recordset
    Dim str As String
    
    Set db = CurrentDb
    Set rs = db.OpenRecordset("select * From [test]")
    rs.MoveFirst
    str = "all date:"

    If Not rs.EOF Then
        Do While Not rs.EOF
            str = str + ";" + CStr(rs.Fields("addDate"))
            rs.MoveNext
        Loop
    End If
    rs.Close
    
    MsgBox str
End Sub
原文地址:https://www.cnblogs.com/blackice/p/4834882.html