Sub Open_dBaseFile()
Dim conn As ADODB.Connection
Dim rst As ADODB.Recordset
Set conn = New ADODB.Connection
conn.Open "Provider=MSDASQL;DSN=MyDbaseFile;"
Set rst = New ADODB.Recordset
rst.Open "Customer.dbf", conn, , , adCmdTable
Do Until rst.EOF
Debug.Print rst.Fields(1).Value
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
conn.Close
Set conn = Nothing
End Sub
|