How to use Visual FoxPro DBC files in Access 2002 (286815)



The information in this article applies to:

  • Microsoft Access 2002

This article was previously published under Q286815
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies only to a Microsoft Access database (.mdb).

For a Microsoft Access 97 version of this article, see 176568.
For a Microsoft Access 2000 version of this article, see 197893.

IN THIS TASK

SUMMARY

This article describes how to access data in a Microsoft Visual FoxPro database (.dbc file) from Microsoft Access 2002.

This article is divided into two parts. The first part explains how to set up a data source that points to a Visual FoxPro database. The second part explains how to import or link tables from a Visual FoxPro database into an Access 2002 database.

back to the top

Part 1: Creating the Data Source in Control Panel

To create a Data Source Name (DSN) that points to a Visual FoxPro database, follow these steps.

NOTE: Because there are several versions of Microsoft Windows, the following steps may be different on your computer. If they are, see your product documentation to complete these steps.
  1. Click Start, point to Settings, and then click Control Panel.
  2. In Control Panel, double-click the ODBC Data Sources (32bit) icon to start the ODBC Data Source Administrator.
  3. In the ODBC Data Source Administrator, click the User DSN tab, and then click Add.
  4. In the Create New Data Source dialog box, click the Microsoft Visual FoxPro driver, and then click Finish.
  5. In the ODBC Visual FoxPro Setup dialog box, in the Data Source Name box, type a name for your new data source, for example, useVFP.
  6. In the Description box, type a description, for example, Visual FoxPro User DSN.
  7. Under Database type, click Visual FoxPro database (DBC).
  8. In the Path box, type the path to your .dbc file, or click Browse to locate the file, and then click OK. The data source is created.
back to the top

Part 2: Linking a Visual FoxPro Table

For an example of how to import or link Visual FoxPro tables in a Visual FoxPro database to an Access database, follow these steps:
  1. Start Microsoft Access.
  2. Open any database.
  3. On the File menu, point to Get External Data, and then click Link Tables.
  4. In the Link dialog box, click the arrow in the Files of type box, and then click ODBC Databases() in the list.
  5. In the Select Data Source dialog box, click the Machine Data Source tab, select the Visual FoxPro DSN that you created in Part 1 of this article, and then click OK.
  6. In the Link Tables dialog box, select a Visual FoxPro table, and then click OK. If you are prompted by a Select Unique Record Identifier dialog box, select the field or fields that uniquely identify each record, and then click OK. The Visual FoxPro table is then linked to your Access 2002 database.
back to the top


REFERENCES

The latest Microsoft Visual FoxPro ODBC driver is available in the Microsoft Data Access Components (MDAC) package, which you can download from the following Microsoft Web site:

back to the top








Modification Type:MajorLast Reviewed:8/13/2004
Keywords:kbHOWTOmaster KB286815 kbAudITPro