Results 1 to 8 of 8

Thread: Access Foxpro data

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    6

    Red face Access Foxpro data

    Hi, I want to retrieve the data from foxpro tables... i already download foxpro driver and installed... i have problem in record sets.. if anyone know post ur comments with examples...

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Access Foxpro data

    Moved to Database Development

    You need to be more specific. What does "i have problem in record sets" mean? Are you getting errors? If so, what? What code are you running that isn't working for you and what, exactly, is happening when you run it?

    Are you connecting to your database without any issue?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    6

    Re: Access Foxpro data

    This is the connection string coding:
    con.Open "DRIVER={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" & App.Path & "\;Exclusive=No;"

    I searched google, all of them explained only about connection string..
    How to access the table in foxpro? Generally foxpro contains only tables.. maybe it doesn't... i work with dbf file for 1st time....

    rs.Open "select * from auay04", con, adOpenDynamic, adLockOptimistic

    error: odbc doesnot support this proprty..

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    6

    Re: Access Foxpro data

    correction:
    con.Open "DRIVER={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" & App.Path & "\test.dbf;Exclusive=No;"

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Access Foxpro data

    Ok, I'm still a bit confused.

    Are you successfully connecting to the database, or is the connection the real issue?

    (Because, if you can't connect properly, there is no way you are going to retrieve anything.)

  6. #6

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    6

    Re: Access Foxpro data

    Connection doesn't show any errors... dbf is a single file or table.. for eg: in access database contains any no of tables.. but in dbf each file is a table.. my problem r as follows,
    1. how to connect
    2. open tables

  7. #7
    Addicted Member Darren M.'s Avatar
    Join Date
    Nov 2005
    Location
    D/FW
    Posts
    200

    Re: Access Foxpro data

    Wow, sounds like my environment, to some degree. Can you post up a couple of file names or the files themselves? Ever play around with dynamic data sources?

    Something like the following. (Exact VB syntax to be added by you.)
    Code:
    Option Explicit
    
    Private Sub MyVFPDBProc()
        Dim strFileName     As String
        
        Const strMY_PATH    As String = "C:\TEMP\"
        
        strFileName = Dir(strMY_PATH & "*.dbf", vbNormal)
        
        Do While Len(strFileName) > 0
        
            con.Open "DRIVER={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" _ 
                                            & strMY_PATH & strFileName & "\;Exclusive=No;"
            
            'Do work on your connection
            '.
            '.
            ' Finish work, close connection
            strFileName = Dir
        Loop
    End Sub
    [Edit for readability]
    Last edited by Darren M.; Jun 26th, 2008 at 09:08 AM.

  8. #8

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    6

    Re: Access Foxpro data

    i finished it using visual foxpro oledb driver.. now its working...during the connection we should not mention the file name, only path..
    sample:
    con.Open "Provider=VFPOLEDB.1;Data Source=" & f & ";Password=;Collating Sequence=MACHINE"
    rs.Open "select * from " & tb, con, adOpenDynamic, adLockOptimistic
    f-contains the path
    tb-contains file name

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width