Solved

Linking FoxPro 2.6 Tables to an Access 2003 database in VB6.

Posted on 2004-09-02
7
287 Views
Last Modified: 2013-12-25
I need a code example in vb6 that will link foxpro dbf files (v2.6) to an access 2003 database, accompanied by the required dll's and odbc settings, if any, to support this. I'll be running the code under windows xp. Either DAO or ADO is fine for data access.
0
Comment
Question by:Carraf
  • 3
  • 2
7 Comments
 
LVL 29

Expert Comment

by:leonstryker
Comment Utility
You do realize that FoxPro v2.6 is DOS based version which is no longer supported?
0
 
LVL 33

Expert Comment

by:CarlWarner
Comment Utility
While FoxPro 2.6 could in fact be DOS based, it was also Windows-based.  That version was the one that was actually cross platform with versions available for DOS, Windows, SCO UNIX/Xenix, and Macintosh.  It was a big effort with 2 character based versions (DOS and UNIX) and two GUI versions (Windows and Mac).  A current connectivity driver should be able to get to that 2.6 data since the underlying structure should be the same no matter the platform it came from.

The latest ODBC driver, that is NOT included with recent MDAC packages, is here:

Visual FoxPro ODBC Driver
http://msdn.microsoft.com/vfoxpro/downloads/updates/odbc/default.aspx

Using ODBC really is the easiest once you have the driver in place because the setup is internal to Access after that point, as outlined in the following MS KB article:

You cannot connect directly to FoxPro databases in Access 2003
http://support.microsoft.com/default.aspx?scid=kb;en-us;824264

Linking to the Fox table at that point from Access goes like this (from the article):

On the File menu, point to Get External Data, and then click Link Tables.
In the Link dialog box, click ODBC Databases in the Files of type list.
In the Select Data Source dialog box, click the Visual FoxPro data source that you created in step 3, and then click OK.
In the Link Tables dialog box, click the tables that you want to import, and then click OK.

There is also an OLE DB Provider for VFP that uses ADO with that isn't a methodology that can be used in the ODBC driver:

Microsoft OLE DB Provider for Visual FoxPro
http://www.microsoft.com/downloads/details.aspx?FamilyId=0F43EB58-7A94-4AE1-A59E-965869CB3BC9&displaylang=en

When you approach the 2.6 data, it should be considered "free table" data and NOT database data, because in 2.6 there were no databases available yet.  Database use was not in place in the Fox world until the next version, VFP3 (and on up to now VFP9 beta to be released late this year).

This should get you started.  Ask away when you're hitting your head against a wall.
0
 
LVL 29

Expert Comment

by:leonstryker
Comment Utility
Thanks Carl,

Leon
0
 
LVL 33

Accepted Solution

by:
CarlWarner earned 500 total points
Comment Utility
I may have lead you astray a bit on the use of ADO in the ODBC driver.  I think it supports it.  What some of us in the Fox area are wishing is that the OLEDB Provider supported the same SQL Pass Through commands (SPT) that the ODBC driver supports.  Those commands are fast and offer the ability to call functions intrinsic to a specific back-end database engine like extended stored procedures, etc.

Anyhow, here's a few ADO links specific to FoxPro that may give you some extra insight with code examples:

[Just tune out the word database if you have FoxPro 2.6 tables and think "free tables".]

Accessing a Visual FoxPro Data Source
http://msdn.microsoft.com/library/en-us/fox7help/html/dgtskAccessingVisualFoxProDataSource.asp?frame=true

Accessing a Visual FoxPro Data Source from Office Components
http://msdn.microsoft.com/library/en-us/fox7help/html/dgtskAccessingVisualFoxProDataSourceFromOfficeComponents.asp?frame=true

ADO Jumpstart for Microsoft Visual FoxPro Developers
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfoxgen/html/adojump.asp

How To Use ADO with a Visual Foxpro Database (this is IIS web server related)
http://support.microsoft.com/default.aspx?scid=kb;en-us;165492
0
 
LVL 33

Expert Comment

by:CarlWarner
Comment Utility
You're welcome, Leon.  I didn't even know this section existed before today. <s>
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now