Run time error 3051

I need to access a foxpro 2.5 for DOS generated dbf file. I appear to have managed this successfully however when the original dos program that uses these dbf files is running my program comes up with the message:

"THE MICROSOFT JET DATABASE ENGINE CANNOT OPEN THE FILE 'F:\C_IHEAD.DBF'. IT IS ALREADY OPENED EXCLUSIVELY BY ANOTHER USER, OR YOU NEED PERMISSION TO VIEW ITS DATA"
 

My program is written in VB6 and the following section of code is used to extract the recordsets:

Private Function GetData() '(sTable As String)
    Dim sSQL As String
    Dim sData As String
    Dim i As Integer
    Set DB = OpenDatabase("f:\chkprint", True, True, "FoxPro 2.6") ' Workstation home
    sSQL = "Select  ih_account, ih_due, ih_region, ih_route from C_ihead WHERE ih_doc = '" & Text1(0).Text & " '"
    Set rs = DB.OpenRecordset(sSQL, dbOpenSnapshot)
    With rs
        Do While Not .EOF
            Label15.Caption = .Fields(0)
            Label9.Caption = .Fields(1)
            Label24.Caption = .Fields(2)
            Label23.Caption = .Fields(3)
            .MoveNext
        Loop
        .Close
   End With
end sub

How can I access this foxpro 2.6 for DOS file without generating this error.
wayne_carlisleAsked:
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.

wayne_carlisleAuthor Commented:
Edited text of question.
0
wayne_carlisleAuthor Commented:
Adjusted points to 190
0
Bob LearnedCommented:
In the OpenDatabase method, the first True is for Exclusive, and the second True is for Read Only.
0

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
wayne_carlisleAuthor Commented:
So close yet so far!!
Thanks
0
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.