?
Solved

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

Posted on 2004-09-02
7
Medium Priority
?
347 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 29

Expert Comment

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

Expert Comment

by:CarlWarner
ID: 11966659
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
ID: 11966813
Thanks Carl,

Leon
0
 
LVL 33

Accepted Solution

by:
CarlWarner earned 2000 total points
ID: 11969693
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
ID: 11969696
You're welcome, Leon.  I didn't even know this section existed before today. <s>
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

764 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