DAO and dBaseIV

Posted on 2000-04-03
Last Modified: 2013-12-25
Anybody know how to open (not link) a dBaseIv database using DAO code?

I've used the samples from MSDN Online
but that just links to a mdb database.

I can create a link using the Connect property, but I only get one record.

Question by:electrick
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 70

Expert Comment

by:Éric Moreau
ID: 2680865

Author Comment

ID: 2680935
Thanks, but that's not the problem. All filenames are 8 chars or less.

I get error 3051 saying the database is opened exclusively by another user. (Which is not true)

LVL 70

Expert Comment

by:Éric Moreau
ID: 2680998
I put this link for you to have a sample.

What is the value of your 3rd parameter? It must be set to False.

Show me your code.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 2681133
I've already printed and used the samples provided by MSDN.

Yes the 3rd parameter is False (that's the default)

My code is the same as all of the MSDN samples.  None of them work.

What I'm looking for is code from someone who has made this work.

LVL 70

Accepted Solution

Éric Moreau earned 200 total points
ID: 2681179
I just tried the code from the link I gave to you:

Private Sub Command1_Click()
Dim db As Database
Dim rs As Recordset

    Set db = OpenDatabase("C:\apps\office\", False, False, "dbase IV;")
    Set rs = db.OpenRecordset("clients")
    Do While Not rs.EOF
        Debug.Print rs.Fields(0).Value
End Sub

It works like it should!

Again, I ask you to show the code. It could be a simple thing that we can't explain unless we see how you use it!

Do you have write access to the folder that contains your DBF file?

Author Comment

ID: 2681306
Yep, your right.  I made it work too.
The only thing I changed was the False param in the 2nd argument.



Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question