I have two "solutions" in one for you.
1. Is it possible that the DBF file is not
dBase IV
? The Mircosoft
Documentation[
^] lists
dBase III
and
dBase 5.0
as other possible values.
2. I read DBF files successfully about 10 years ago using ODBC with the following
ConnectionString
for the DBASE files. Multiple DBF files are read via one
Connection
object. The DBF full path filename is specified in each
SELECT
statement not in the
ConnectionString
. I included references to Microsoft documentation for ODBC for dBase files at the end of this solution.
Below is some sample VB.NET code that should get you started.
Imports Microsoft.Data.Odbc
...
...
Dim cn As OdbcConnection = New OdbcConnection()
cn.ConnectionString = "DRIVER={Microsoft dBase Driver (*.dbf)};Deleted=1"
cn.Open()
Dim obCommand As OdbcCommand
Dim strSQL As String = "SELECT ID,text_type,text_line,text_data FROM " & strPath & strSource_DBF_Filename
obCommand = New OdbcCommand(strSQL, cn)
Note: ID,text_type,text_line,text_data are columns names in my DBF file.
Tested: Visual Basic .NET 2003
Microsoft Documentation for ODBC DBASE Driver:
Microsoft ODBC Desktop Database Drivers[
^]
dBASE Driver Programming Considerations[
^]
dBASE Data Types[
^]
Setting Options Programmatically for the dBASE Driver[
^]