Link to home
Start Free TrialLog in
Avatar of john
johnFlag for United States of America

asked on

import foxpro into Access and list tables

I need to import into Access (2003 0r 2007) foxpro
3 file types .dbf  .fpt  .cdx  
I would also need to list tables.
So I could read them them

.  I have a VFPodbc.dll  dirver

I probably jsut need the code to connect to, list tables, then I could easy read fields and import into something I can use.

THANKS!

thanks
Avatar of Cyril Joudieh
Cyril Joudieh
Flag of Lebanon image

Create or open a database in Access.
Go to tables and right click in the open area and then choose Import
Choose dBase IV as format and choose the DBF file and it will use the rest.
is there a dbc file in that folder or up one folder perhaps? If not, then these are free tables or fox2.x tables. Here's the connectionstring to use: http://www.connectionstrings.com/visual-foxpro#90

so it's perhaps "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=c:\yourdbffolder;Exclusive=No; Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;"

Or simply create a DSN, you have the two options of a database or a directory of free tables. Make sure your vfpodbc.dll is sufficient. What's preinstalled with windows is awfully outdated, even though the newest ODBC driver is also rather old. You get Visual Foxpro ODBC Driver 1.00.02.00 in Vista for example. The newest one is here: http://msdn.microsoft.com/en-us/vfoxpro/bb190233.aspx

After you have the DSN you can simply import into Access tables via binding to a remote ODBC database and go from there.

Bye, Olaf.
Avatar of john

ASKER

CaptainCyril:
when importing in Access:  I got a message " not in expected  format" I'm going to ask them to resend file.

I have a DBF  CFX and FPT  file.  FPT is largest.

Olaf_Doschke:
I will check out your suggestions
thanks
They can copy the file to you in an older format of DBF. FoxPro can do that.

COPY TO table TYPE FOXPLUS

or

COPY TO table TYPE FOX2X

You can copy it using Olaf's method which is great however, it needs programming. You can also copy the whole file from FoxPro to a newly created mdb.
Cyril, what programming? In Access you can import to access tables from an ODBC source, all you need to do is setup a connection, that' not what I consider programming. Assumed you have setup a DSN to the DBFs you can do this in Access (2007):

-create a new MDB (in 2007 accdb)
-menu: Remote data
-in "import data" choose "other" - ODBC database
-in the dialog appearing choose the upper import rather than the lower connect option
-choose the DSN
the rest will follow

No programming.

The connectionstring is merely what you can use to setup the DSN.

Bye, Olaf.
I thought you needed to write a script like SQLSTRONGCONNECT or something.

I apologize then.
Avatar of john

ASKER

Olaf_Doschke:
Taking your advice, I tried to set up a V fox pro ODBC on 2 of my PCs(XP pro access 2007,2003)
and I need to install the v fox pro driver, I read its in the MDAC 2.5 , apparently not so.  
I'm looking for it.....
thanks
You may need the OLE DB driver instead of the ODBC driver if the VFP files use features introduced after VFP6. It can be found at http://www.microsoft.com/downloads/details.aspx?familyid=E1A87D8F-2D58-491F-A0FA-95A3289C5FD4&displaylang=en

But I have no idea about Access or if it can connect to OLEDB
ASKER CERTIFIED SOLUTION
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial