Opening a dBASE file with ADO : dBASE ADO « Access « VBA / Excel / Access / Word






Opening a dBASE file with ADO

 
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

 








Related examples in the same category

1.Open dBase file and query data