Page 1 of 1

How to access a Visual Fox Pro 8 database

Posted: Fri 18 Jul 2014 14:58
by JORGEMAL
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

Re: How to access a Visual Fox Pro 8 database

Posted: Mon 21 Jul 2014 13:51
by Pinturiccio
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

Re: How to access a Visual Fox Pro 8 database

Posted: Mon 21 Jul 2014 14:40
by JORGEMAL
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

Re: How to access a Visual Fox Pro 8 database

Posted: Fri 25 Jul 2014 12:28
by Pinturiccio
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;";