Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 6th, 2009, 02:18 PM
Newbie
 
Join Date: Jan 2009
Posts: 2
Default Trouble with importing Visual FoxPro 2.1 .dbf files into Access 2003

Hello,

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.
Reply
  #2  
Old January 6th, 2009, 07:33 PM
Forum Leader
 
Join Date: Feb 2008
Location: Beauly, near Inverness, Scotland
Posts: 1,538
Default

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.

-Stewart
Reply
  #3  
Old January 6th, 2009, 09:30 PM
Forum Leader
 
Join Date: Feb 2008
Location: Beauly, near Inverness, Scotland
Posts: 1,538
Default

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...

http://msdn.microsoft.com/en-us/libr...86(VS.71).aspx

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!

-Stewart
Reply
  #4  
Old January 7th, 2009, 02:05 PM
Newbie
 
Join Date: Jan 2009
Posts: 2
Default

I was able to find a work around. Thanks for the reply.
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.