Extracting information from Fox Pro or another Database

  • Is it possible to write code in Excel that can pull specific information from Fox Pro or another database?


    If so, is it possible to go to a specific table in the database?

  • Assuming you have the necessary ODBC driver for your database, you can set up either a pivot table or an External database query to retrieve the desired information. This can be done without code using Excel's menus, or you could write code to automate the process.

  • Thanks Derk.


    Is there any specific formula for the Pivot Table? We do have a formula for extracting information from a pivot table.


    what would be formula for creating a pivot table from an external database?

  • I know how to create a pivot table. what I was referring to was an Excel worksheet function that extracts the information using the GetPivotData function.


    would this be the one I would use?

  • You will first need to create the pivot table the usual way but selecting as the source your external database (and then the relevant table or query from that database). You can't just have a cell function directly query the external database.

  • Thanks Derk,


    I went through the Wizard and was able to find the Database to which I wanted to extract the information. I wasn't able to open the file to connect to the exact table. Is there a trick to doing that?

  • When you got to the "Chose Data Source" dialog you should scroll down and select a Visual Foxpro driver (or the approrriate driver if it's another database type) rather than browse at that point. after yiou have selected the driver and said OK you will have the opportunity to browse to your database and then in MSQuery select the specific table for your query.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!