471,624 Members | 2,097 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,624 software developers and data experts.

Trouble with importing Visual FoxPro 2.1 .dbf files into Access 2003


Iíve been given the task of importing .dbf files from a very old version of Visual FoxPro (version 2.1) into Access (2003). When I import the data straight to Access it errors with:

External table is not in the expected format. (Error 3274)

Iíve tried the following but it did not work:
ďTo import data from a FoxPro database, use the Microsoft Visual FoxPro ODBC driver. To do so, follow these steps:
1. Click Start, and then click Control Panel.
2. In Control Panel, double-click Administrative Tools.
3. In the Administrative Tools window, double-click Data Sources (ODBC), and then add a new ODBC data source for your FoxPro database or tables by selecting the appropriate Visual FoxPro driver.
4. Start Access, and then open your Access database.
5. On the File menu, point to Get External Data, and then click Import.
6. In the Import dialog box, click ODBC Databases in the Files of type list.
7. In the Select Data Source dialog box, click the Visual FoxPro data source that you created in step 3, and then click OK.
8. In the Import Objects dialog box, click the tables that you want to import, and then click OK. ď

If I open the file with excel or as text it begins with .dbc then begins the data stream on one line. Does anyone know of a way to import these files into Access? Any help would be very much appreciated.
Jan 6 '09 #1
3 4894
Stewart Ross
2,545 Expert Mod 2GB
Hi. It would help us greatly if you could let us know in which way your ODBC attempt did not work. Were you unable to set up an ODBC connection, or what?

Using the FoxPro ODBC driver is the right way to go, as it will allow you to access the tables within the FoxPro database via one of Microsoft's own drivers. It will also allow you to access the tables within the FoxPro DB from any ODBC-compliant application, including Excel.

Attempting to open the file as text or via Excel (without using the ODBC driver) simply will not work. Like Access itself and any other proprietary database the file structure is not amenable to interpretation as text or to being opened as some form of simple byte stream - any more than you can open any other structured binary file as if it were a byte stream.

If you still had a working FoxPro installation you could always use its facilities to export the data into some intermediate format that Access can import directly - either as text files, CSVs or even DBase DBFs or similar if these choices are available. If you do not have FoxPro any more the ODBC route is the only workable one I can think of - and the built-in drivers are intended for just such a purpose.

Jan 6 '09 #2
Stewart Ross
2,545 Expert Mod 2GB
For your reference, here is a link to a web page which specifies the file structure of a FoxPro DB. I would hesitate even to start considering deconstructing such a file, but if you are feeling very brave perhaps this is for you...


If you find setting up an ODBC link daunting then the prospect of delving into the file structure at such a low level is surely much worse!

Jan 6 '09 #3
I was able to find a work around. Thanks for the reply.
Jan 7 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

63 posts views Thread by Jerome | last post: by
1 post views Thread by sanrock | last post: by
6 posts views Thread by JimmyKoolPantz | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.