Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 360
  • Last Modified:

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

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
Carraf
Asked:
Carraf
  • 3
  • 2
1 Solution
 
leonstrykerCommented:
You do realize that FoxPro v2.6 is DOS based version which is no longer supported?
0
 
CarlWarnerCommented:
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
 
leonstrykerCommented:
Thanks Carl,

Leon
0
 
CarlWarnerCommented:
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
 
CarlWarnerCommented:
You're welcome, Leon.  I didn't even know this section existed before today. <s>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now