locked
Query Visual FoxPro Database from SQL Server Management Studio RRS feed

  • Question

  • Hi

    Is there a way to query a Visual Fox Pro database from SQL Server Management Studio?

    I have successfully used the Microsoft OLE DB Provider for Visual FoxPro 9.0 to query a Visual Fox Pro database from Visual Studio. I have SQL Server 2008 Enterprise installed.

    Thursday, May 27, 2010 3:29 AM

Answers

All replies

  • Did you try to set up a linked server to VFP database?
    Premature optimization is the root of all evil in programming. (c) by Donald Knuth

    Naomi Nosonovsky, Sr. Programmer-Analyst

    My blog
    Thursday, May 27, 2010 4:25 AM
  • Yes. I couldn't see the Visual Fox Pro Provider in the list of Providers.

    Thursday, May 27, 2010 6:33 PM
  •  Even though the following MS support article describe SQL 2000 I belive it should work on SQL 2008.

    How to add a Visual FoxPro database to SQL Server as a linked server
    http://support.microsoft.com/kb/199131

    How to do   distributed queries with FoxPro .dbf files
    http://support.microsoft.com/kb/207595

    Thursday, May 27, 2010 6:54 PM
  • Is your OS 32 bit or 64 bit? There is no 64 bit VFPOleDB driver. Take a look also at http://berezniker.com/content/pages/visual-foxpro/visual-foxpro-odbc-driver
    Premature optimization is the root of all evil in programming. (c) by Donald Knuth

    Naomi Nosonovsky, Sr. Programmer-Analyst

    My blog
    • Proposed as answer by Chirag Shah Thursday, May 27, 2010 7:46 PM
    Thursday, May 27, 2010 7:00 PM
  • Hi

    I was able to create a Linked Server using the following code:

    EXEC sp_addlinkedserver
       @server = N'Test',
       @provider = N'VFPOLEDB',
       @srvproduct = N'Microsoft OLE DB Provider for Visual FoxPro',
       @datasrc = N'\\PC1\data\master.dbf';
    GO

    When I test the connection I get this error:

    --The OLE DB provider "VFPOLEDB" has not been registered. (Microsoft SQL Server, Error: 7403)

    I successfuly registered VFPOLEDB and it now shows in the Providers folder under Linked Servers. I can also use the GUI now to create a Linked Server and select the Microsoft OLE DB Provider for Visual FoxPro but I still get the error above.

    Any idea's?

    Thursday, May 27, 2010 8:51 PM
  • My system is 32-bit. My trial copy of Visual Studio can connect to the Visual FoxPro database using the Microsoft OLE DB Provider for Visual FoxPro but I need to use SQL Server Management Studio (or something similar) to test the FoxPro queries I have written.
    Thursday, May 27, 2010 8:55 PM
  • Download and reinstall Microsoft OLE DB Provider for Visual FoxPro 9.0, make sure you read the instructions posted on the download page

     

    http://www.microsoft.com/downloads/details.aspx?familyid=E1A87D8F-2D58-491F-A0FA-95A3289C5FD4&displaylang=en

     

    Somehow SQL does not see your OLEDB provider  for foxpro registered..no clue why but try reinstalling it.

    • Marked as answer by KJian_ Thursday, June 3, 2010 2:46 AM
    Thursday, May 27, 2010 8:56 PM