Link to home
Start Free TrialLog in
Avatar of gritscbs
gritscbs

asked on

Access VFP 9 tables with Crystal Reports

I am trying to create crystal reports from Visual Foxpro 9 tables on an XP Pro laptop.  When I attempt to setup the ODBC driver I get an error message stating that I need to install the latest version of the VFP ODBC driver and it directs me to the VFP downloads and states that I should download the ODBC driver but the driver doesn't exist at the site (and I am rather sure it is already installed in that the VFPODBC.DLL is in the system32 directory.  I then attempted to do this on a Win 2000 laptop and was able to use the driver but no tables were visible when I selected it as a data source in Crystal Reports XI.  I have also investigated using the OLEDB but I don't have a souce, username or password and crystal prompts for this information.  Any suggestions?
ASKER CERTIFIED SOLUTION
Avatar of CarlWarner
CarlWarner
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I was checking out some test code in VFP9 and saw I had this in my command history:

foxconn = NEWOBJECT('ADODB.CONNECTION')
foxconn.Open('Provider=VFPOLEDB;Data Source=D:\;Mode=ReadWrite;Collating Sequence=MACHINE;')

The pount is, you don't need to worry about the login and password part and, if you want to attach to a free table, you don't need to supply the database name.  Just put in as much as you need and know.
In case you're interested in more on VFP and Crystal Reports:

Intro to Crystal Reports with VFP
http://fox.wikis.com/wc.dll?Wiki~IntroToCrystalReports~VFP

KB010: Using Crystal Reports with VFP
http://www.craigberntson.com/Articles/kb010.htm

KB013: Designing Reports with Crystal Reports
http://www.craigberntson.com/Articles/kb013.htm

KB014: Integrating Crystal Reports with Visual FoxPro
http://www.craigberntson.com/Articles/kb014.htm

Using Crystal Reports with Visual FoxPro
http://www.ml-consult.demon.co.uk/foxst-19.htm

CrysDev: A Developer's Guide to Integrating Crystal Reports
http://www.hentzenwerke.com/catalog/crysdev.htm
Avatar of gritscbs
gritscbs

ASKER

Thank you very much.

The OLE DB data source solved the problem.  It seems to be working very well.
Excellent and you're welcome.
At this point we are just getting started with the product based on the FoxPro database. We are converting from a legacy text base system. I work for a good sized Water Utility and we have Oracle databases for most of the system. As you can imagine the Foxpro product is not as sophisticated. Anyway I think I will try to put hooks right into the FoxPro *.dll and will let everyone know how that turns out. Also we did try Crystal Reports XI on the dataset and it does work.

                                                                                                   Thanks,
                                                                                                   Bob H