• Linking to Visual FoxPro (any)

    Author
    Topic
    #388295

    Anyone had any luck linking to VFP files? I’ve got some VPF .dbf and .cdx files; unfortunately I don’t know from which version, although I suspect is it relatively recently. I changed the names to 8.3 format as this apparently may prevent some problems.

    From Access97, if I select the VPF file type when I go to Link, it allows me to select the .dbf and then asks for the .cdx file, and apparently is fine. However, as soon as I hit Close, I get an error “Cannot access the FoxPro 3.0 dbf file”.

    From either Access97 or Access2000, if I try to use ODBC, after screwing around with the DSN and everything, I eventually can get to a pop-up screen entitled Linked Tables that is supposed to show me all the dbf files in the directory I specified, but this box is blank!

    It’s all very frustrating.

    Viewing 0 reply threads
    Author
    Replies
    • #681233

      I believe that you can link to FoxPro up to version 2.5, beyond that you have to use the ODBC feature.

      If we had the “search” facility MarkD has the explanation for this in an old post and covers it extremely well.

      • #681237

        As I mentioned, I’m still having problems with the ODBC solution. After some testing, however, I’m starting to wonder if the files I’m working with are actually Visual FoxPro files; it seems ODBC will recognize them as FoxPro files.

        • #681255

          I’m MarkD but I can’t locate my own previous reply either. If you are not seeing any tables listed in the ODBC Link Tables dialog in Access when attempting to link to VFP tables, it’s usually because the ODBC DSN was not properly configured. If the FoxPro tables in question are VFP 3.0 or later, you have to specify the VFP database file (.DBC extension) in the ODBC setup, and browse to locate the .DBC file – see attached illustration msg. Note that “Visual FoxPro database (.DBC)” must be selected under Database Type options. If the FoxPro tables are FoxPro 2.6 or earlier (before it became “Visual”) then you’d select “Free Table directory” option and specify folder only (as you would for dBase tables). ACC 97 provided ISAM support for FoxPro, making it relatively simple to link/import FoxPro tables. For reasons MS never fully explained, ISAM support for FoxPro/VFP was dropped in A2K & later, so you have to use ODBC. Unless you purchase VFP 7.0 or later, then you can use the VFP OLEDB provider to connect via ADO – MS does not “provide” this provider in MDAC or elsewhere unless you purchase the product….

          I’d recommend modifying ODBC DSN & see which option works. Note that if the .DBF files in question are actually dBase, not FoxPro/VFP tables, you should be able to link to them via one of the dBASE ISAM drivers since these are still supported in A2K & later. If neither VFP option works, I’m afraid I would not have an answer. I’ve been struggling with FoxPro for a long time (converting old FoxPro programs to Access) and basically loathe it….

          HTH

          • #681261

            I seem to be getting mixed signals from Access, so I’m not sure what is what. I don’t think there was any .dbc files when I copied it over at client site, only .dbf and .cdx (and one .fpt table). I copied one of the .dbf files into the Office directory, which contains some sample .dbf files. When I configured the DSN to look in that directory, the ODBC Linked Tables popup saw the sample files but not the one I copied in! I had specified the Visual FoxPro driver, and the Free Table Directory.

            If I try to come at it from Access97 using the old drivers, I get a message something like “can’t access FoxPro 3.0 database”.

            I don’t know what the current version of FoxPro is. Could this be the latest version, later than the ODBC driver can handle?

            • #681476

              If the .DBF file was created in VFP as a standalone “free table” (for exporting to another user, for example), you should be able to link the table via ODBC “Free Table” option. However, if the .DBF file is part of a VFP “project”, where the .DBC file “catalogs” all the objects in the database, you will NOT be able to link the table w/o the .DBC file. Testing with some VFP 6.0 files on my system, if you copy some .DBF files that are part of a .DBC project to another folder containing some VFP free tables, and link via an ODBC “Free Table” DSN, the free tables ONLY will be listed in the Link Tables dialog. If you copy the .DBF files, any associated index (.CDX) & memo (.FPT) files, AND the .DBC file to another folder, and set up a DSN using VFP database (.DBC) option, you will be able to link the table. But note that when the Link Tables dialog opens, ALL tables associated with the .DBC project will be listed, not just the tables you copied to new location. If you try to link to a table that was not copied to new location, you’ll get an ODBC “could not find linked table” error msg. Note also there may be a .DCT (memo) file associated with the .DBC file, this file must also be copied to new location or ODBC call will fail with a colorful error msg.

              Recommend check source VFP database to determine if these files are part of .DBC project and make sure copies of .DBC and .DCT files are provided. Trying to link to the .DBF files that belong to a project w/o the .DBC file is roughly analogous to trying to link an Access table w/o specifying the source .MDB file. The most recent version of VFP files on my system is VFP 6.0 so I don’t know if there are any issues involving using ODBC with later versions. The current version of VFP is 8.0 (just released).

            • #681489

              As I’ve just found out, it is the missing .dbc file that is causing my problems. I wasn’t aware of the existance and importance of the .dbc file, so when I copied files from the client computer, I only pickedup a few .dbf and .cdx files that would fit on a diskette. (I had once done some conversion work on old FoxPro files, and that’s all that was needed back then.)

    Viewing 0 reply threads
    Reply To: Linking to Visual FoxPro (any)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: