Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access database

Status
Not open for further replies.

quakeunity77

IS-IT--Management
Jun 3, 2010
36
US
Is it possible to have VFP 9 open and use an Access database?
I know that there are converters but I want to be able to use the Access database without conversion to foxpro.
 
Your VFP application can do 'direct' data reads/writes to data tables within an M$ ACCESS through ODBC connections.

You MIGHT run into privilege issues, but again you might not.

You might want to look over references found as a result of a Google search for: import access into vfp such as:
How to import table structures and data from Microsoft Access to Visual FoxPro

Good Luck,
JRB-Bldr
 
In the Foxpro command window type

HELP remote data

In this case, the Access data is "remote" (even if it's on your local hard disk).
 
Yes, there are two ways of accessing the data in an Access database:

1. Using ODBC. This is exactly the same way as accessing SQL Server, MySQL and the like. It lets you use remote views, SQL pass-through, cursor adapters, etc.

2. Using OLE Automation. This is similar to the method of accessing Microsoft Word and Excel from within VFP.

Both methods let you read and update the data. With the first method, that's about all you can do. The second method might also let you run reports, macros, etc. (not sure about that).

I suggest you read up on both methods and decide which one is more likely to meet your needs. Then come back if you have any detailed questions.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
All I'd add to Mike's advice is that you've got to have Access installed in order to go the Automation route. You're also likely to hit minor problems when the user upgrades Access.

I'm fairly sure that the ODBC technique will work on the mdb file without Access being installed. Can't test that here because every machine in sight has Access on it.

Geoff Franklin
 
I'm fairly sure that the ODBC technique will work on the mdb file without Access being installed.

I can confirm that. I show the technique in one of my FoxPro courses, and it has worked at sites where Access wasn't installed.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Make sure your Access database doesn't have table names that contain blank spaces(other funny characters may create the same problem).

When trying to create a remote view, VFP will turn the blank spaces into underscores without telling you anything(not nice), then it won't connect because the table names are not corresponding.

So I had to rename Access tables first, then connect to Access tables with Remote Views. (To rename/revert table names I used VBscript run from my VFP program).

Hope you're luckier...

-gl

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top