How to access a Visual Fox Pro 8 database

How to access a Visual Fox Pro 8 database

Postby 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
JORGEMAL
 
Posts: 164
Joined: Thu 03 Jul 2008 23:55

Re: How to access a Visual Fox Pro 8 database

Postby 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/universal/docs/?AnyProvider.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/universal/docs/?Providers.html
Pinturiccio
Devart Team
 
Posts: 1983
Joined: Wed 02 Nov 2011 09:44

Re: How to access a Visual Fox Pro 8 database

Postby 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/details.aspx?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
JORGEMAL
 
Posts: 164
Joined: Thu 03 Jul 2008 23:55

Re: How to access a Visual Fox Pro 8 database

Postby 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;";
Pinturiccio
Devart Team
 
Posts: 1983
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect Universal