Open and read a .DBF file into a datagrid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nhan
    New Member
    • Apr 2007
    • 3

    Open and read a .DBF file into a datagrid

    Hi every one. I'm new to VB .NET and this is my first try of reading in a data.DBF file. After many trial and err, i was able to populate the datagrid with values. but my problem is that I have to open the data.DBF file in excel first before I can use VB to populate it, else I got the error: "External table is not in the expected format"
    Any insight thought for this problem?
  • Nhan
    New Member
    • Apr 2007
    • 3

    #2
    Never mind, I figured out the problem. I was using the excel com to read the .dbf file, and that was probably the problem.
    My connection used to be:
    olecon = New OleDbConnection ("Provider=Micr osoft.Jet.OleDb .4.0;" & _
    '"Data Source=" & sSource & " Extended Properties=""Ex cel 8.0;IMEX=1;HDR= YES""")

    Now it is:

    olecon = New OleDbConnection ("Provider=Micr osoft.Jet.OleDb .4.0;" & _
    "Data Source=" & sTest & " ;Extended Properties=""dB ase III""")
    I just run the program and realized i don't have to open the data.dbf in excel before I can open it in visual basic

    Comment

    Working...