• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2106
  • Last Modified:

Open DBF file

How can I open DBF file in Window2000 & VB6 ?
1 Solution
one option:

ODBC Driver for dBASE

oConn.Open "Driver={Microsoft dBASE Driver (*.dbf)};" & _
                  "DriverID=277;" & _

Note: Specify the filename in the SQL statement. For example:
         oRs.Open "Select * From user.dbf", oConn, , ,adCmdText

Note: MDAC 2.1 (or greater) requires the Borland Database Engine (BDE) to update dBase DBF files.

and i haven't had much experience with w2k but it should still work.
YuanyuAuthor Commented:
1. what does "DriverID=277;" mean?
2. How can I update DBF file with the Borland Database Engine? Is BDE free? Any other free tools can I use?
7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

YuanyuAuthor Commented:
I can use jet3.51 to open DBF with DAO in Win95/98, but failed in Win2000.
This worked for me...

Dim rstWhatever As Recordset
Dim dbName As String
Dim ConnString As String
    dbName = App.Path & "\whatever.MDB"
    ConnString = "Provider=Microsoft.JET.OLEDB.4.0;Data
        Source=" & dbName
    Set m_conn = New Connection
    m_conn.Open ConnString

    Set rstWhatever = New Recordset
    rstWhatever.Open "SELECT * FROM Whatever", m_conn,
        adOpenStatic, adLockOptimistic
YuanyuAuthor Commented:
sorry, tlw2651, your answer does not refer to my question. I need to open DBF file and not MDB file with VB6 in win2000. Data source setting is not my expectant answer.
An integer ID for the driver.
21 (dBASE III)
277 (dBASE IV)
533 (dBASE 5.0)

good luck
Hi Yuanyu,
As you are using win2k, you are also using MDAC 2.5, support for dBase files using the dBase drivers was partially withdrawn in MDAC 2.5 unless you are using the BDE as well. You can use the Microsoft Visual Foxpro driver to update/insert records to a dBase file. However using this driver you do not have the ability to use the dBase index files. This may or may not be a problem for you.
Hi Yuanyu,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days.  I will suggest to:

    Split points between: bobbit31 and TimCottee

Yuanyu, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will followup.

EXPERTS: Please post closing recommendations.
DanRollins -- EE database cleanup volunteer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now