Open DBF file

How can I open DBF file in Window2000 & VB6 ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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?
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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
TimCotteeHead of Software ServicesCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.