How to access a Visual Fox Pro 8 database

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for universal data access
Post Reply
JORGEMAL
Posts: 168
Joined: Thu 03 Jul 2008 23:55

How to access a Visual Fox Pro 8 database

Post by JORGEMAL » Fri 18 Jul 2014 14:58

I need to access an old Visual Fox Pro 8 database from our application which was developed with Visual Studio 2013 and dotConnect for PostgreSQL and I know I can use ODBC or OLE DB. Will dotConnect Universal help me achieve my goal? If so, please explain.

Respectfully,
Jorge Maldonado

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: How to access a Visual Fox Pro 8 database

Post by Pinturiccio » Mon 21 Jul 2014 13:51

dotConnect Universal can work with any ADO.NET provider. If you find an ADO.NET provider working with Visual Fox Pro, you can use it with dotConnect Universal via the UniProvider component. For more information, please refer to http://www.devart.com/dotconnect/univer ... vider.html.

dotConnect Universal has a set of supported providers that you can use without additional settings. There are ODBC and OLE DB providers among the supported providers. For more information, please refer to http://www.devart.com/dotconnect/univer ... iders.html

JORGEMAL
Posts: 168
Joined: Thu 03 Jul 2008 23:55

Re: How to access a Visual Fox Pro 8 database

Post by JORGEMAL » Mon 21 Jul 2014 14:40

I installed dotConnect Universal Standard but nothing is shown in the Toolbox. Are there any Devart visual elements for web forms? I guess not in the case of the standard version because there are no ADO.NET providers included. Let me know if I am correct.

What should I take into account in order to establish a connection to a VFP database? If I run the code below I get a message saying " Unknown provider: vfpoledb" and I already downloaded and installed it from here (http://www.microsoft.com/en-us/download ... x?id=32602). I will very much appreciate any help.

Code: Select all

protected void Page_Load(object sender, EventArgs e)
    {
        String strMensaje = "";
        String strConnString = @"Provider=vfpoledb;Data Source=z:\DatosCtes\dbadmctes.dbc;Collating Sequence=machine;";
        String strCommand = "SELECT * FROM catctes";

        UniConnection objConn = new UniConnection(strConnString);
        UniCommand objCommand = new UniCommand(strCommand, objConn);
        objConn.Open();
        UniDataReader drInfo;
        
        try 
        { 
            drInfo = objCommand.ExecuteReader();
            grdPrueba.DataSource = "drInfo";
        }
        catch (Exception objException)
        {
            strMensaje += objException.Message + "\n";
            strMensaje += objException.StackTrace + "\n";
        }
        
        objConn.Close();
    }
Best regards,
Jorge Maldonado

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: How to access a Visual Fox Pro 8 database

Post by Pinturiccio » Fri 25 Jul 2014 12:28

According to your reference, you use the Microsoft OLE DB Provider for Visual FoxPro 8.0. This provider is an OLE DB provider, and you need to use the following connection string for it:

Code: Select all

@"Provider=OLE DB;OLE DB Provider=vfpoledb;Data Source=z:\DatosCtes\dbadmctes.dbc;Collating Sequence=machine;";

Post Reply