hello all..

Hi, I'm having problem to read *.DBF (DBase File) using VB.NET.
Below is my code :

Public abc As String = "C:\Documents and Settings\LASIM\My Documents\20100126a\JADUAL\TCMSV2"
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim sql As String
        Dim connection As String
        Dim dsXML As New DataSet
        Try
            sql = "Select * from badge.BDF"
            connection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " + abc + ";Extended Properties=dBASE IV;User ID=Admin;Password="
            Dim sqlConn As New OleDbConnection(connection)
            Dim ds As New DataSet

            sqlConn.Open()
            If sqlConn.State = ConnectionState.Closed Then
                MsgBox("kitty")
            End If
            Dim adp As New OleDbDataAdapter(sql, sqlConn)
            adp.Fill(ds)  <--error here
            dsXML.WriteXml("c:\testing.xml")
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
end sub

plz help me.. tq

Are you sure that the internal format of the dbf file is dBASE IV?
There are many formats to manage depending on the utility used to create the dbf file(dBase, Clipper, etc.)

Did you already tryed to import in an access database to verify if the format is valid?

thanks for reply.. question solved... :-)

Glad to know. Then, please, be so kind to mark this thread a s solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.