0

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

Edited by __avd: Added [code] tags.

2
Contributors
3
Replies
5
Views
6 Years
Discussion Span
Last Post by lolafuertes
0

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?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.