Solved

DAO and dBaseIV

Posted on 2000-04-03
6
271 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 69

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 69

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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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 69

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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 …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now