Solved

DAO and dBaseIV

Posted on 2000-04-03
6
292 Views
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.

Thanks,
Rick
0
Comment
Question by:electrick
  • 3
  • 3
6 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2680865
0
 

Author Comment

by:electrick
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)

0
 
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.
0
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 

Author Comment

by:electrick
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.

Thanks,
Rick
0
 
LVL 70

Accepted Solution

by:
É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
        rs.MoveNext
    Loop
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?
0
 

Author Comment

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

Thanks,

Rick
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 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