We help IT Professionals succeed at work.

import foxpro into Access and list tables

john
john asked
on
1,104 Views
Last Modified: 2013-11-27
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
Comment
Watch Question

Cyril JoudiehFounder, Software Engineer, Data Scientist

Commented:
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.
Olaf DoschkeSoftware Developer
CERTIFIED EXPERT

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

Author

Commented:
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
Cyril JoudiehFounder, Software Engineer, Data Scientist

Commented:
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.
Olaf DoschkeSoftware Developer
CERTIFIED EXPERT

Commented:
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.
Cyril JoudiehFounder, Software Engineer, Data Scientist

Commented:
I thought you needed to write a script like SQLSTRONGCONNECT or something.

I apologize then.

Author

Commented:
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
Software Developer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.