Hi Hilton,
Assuming your DBFs are FoxPro DBFs, you can download the FoxPro and Visual
FoxPro OLE DB data provider from the link before my signature. It works with
all versions of FoxPro DBFs.
Here's some example VB code:
Try
Dim cn1 As New OleDbConnection( _
"Provider=VFPOLEDB.1;Data Source=C:\Temp\;")
cn1.Open()
'-- Make some VFP data to play with
Dim cmd1 As New OleDbCommand( _
"Create Table TestDBF (Field1 I, Field2 C(10))", cn1)
Dim cmd2 As New OleDbCommand( _
"Insert Into TestDBF Values (1, 'Hello')", cn1)
Dim cmd3 As New OleDbCommand( _
"Insert Into TestDBF Values (2, 'World')", cn1)
cmd1.ExecuteNonQuery()
cmd2.ExecuteNonQuery()
cmd3.ExecuteNonQuery()
cn1.Close()
Dim cn2 As New OleDbConnection( _
"Provider=VFPOLEDB.1;Data Source=C:\Temp\;")
cn2.Open()
Dim cmd4 As New OleDbCommand( _
"Select * From TestDBF", cn2)
Dim da1 As New OleDbDataAdapter(cmd4)
Dim ds1 As New DataSet
Dim dr1 As DataRow
da1.Fill(ds1)
For Each dr1 In ds1.Tables(0).Rows
Console.WriteLine(dr1.Item(1).ToString())
Next
Console.ReadLine()
cn2.Close()
Catch e As Exception
MsgBox(e.ToString())
End Try
--
Cindy Winegarden
(e-mail address removed)
VFP OLE DB:
http://msdn2.microsoft.com/en-us/vfoxpro/bb190232.aspx
VFP ODBC:
http://msdn2.microsoft.com/en-us/vfoxpro/bb190233.aspx