ITMike_M.


Hi,

I am trying to get records from our legacy application w/c is visual foxpro apps. Since it doesn't have any *.dbc I tried accessing it thru free tables using this connection string: "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=c:\myvfpdbfolder;Exclusive=No;Collate=Machine;NULL=NO;DELETED=NO;BACKGROUNDFETCH=NO;" but to no avail. I tried connecting using ODBC DSN but still I'm getting this error/exception

An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll

Additional information: An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.

I checked the location and everything and permission as well (though it's on my HD only and I can see the records thru VFP 6.0) . Upgraded the MDAC 2.8 SP1 but still nothing. What could be the cause of this error Pls. help me, I really need this to work. Thanks!



Re: ERROR in VFPOLEDB.1 (Moved thread)

Bruno Yu - MSFT


I am moving this thread from Base "Visual Basic General" forum to the "Visual FoxPro General" forum, since the issue is related to Visual FoxPro. There are more Visual FoxPro experts in the "Visual Basic General" forum.







Re: ERROR in VFPOLEDB.1 (Moved thread)

CetinBasoz

The thread title says OLEDB but the connectionstring says it's ODBC. It's not clear what really you were trying to use. ODBC drivers are not updated since 2.5 (or 2.6) MDAC so 2.8 doesn't have it. You should use OLEDB anyway.

Here is a sample, assuming your data files are in a folder named "c:\my folder":

Code Snippet

using System;

using System.Data;

using System.Data.OleDb;

class sample

{

static void Main()

{

OleDbConnection con = new OleDbConnection( @"Provider=VFPOLEDB;Data source = c:\my folder" );

OleDbCommand cmd = new OleDbCommand( "select * from myFreeTable", con );

con.Open();

OleDbDataReader rdr = cmd.ExecuteReader();

while ( rdr.Read() )

{

Console.WriteLine( rdr[0] );

}

rdr.Close();

con.Close();

}

}






Re: ERROR in VFPOLEDB.1 (Moved thread)

ITMike_M.

Hi,

Oops! Sorry wrong posting of code. I tried using ODBC after OLEDB since it did not work. This is to further look w/c is causing me the headache.

I tried use since it's the same as mine, but it did not work as well.

Thanks!




Re: ERROR in VFPOLEDB.1 (Moved thread)

Cindy Winegarden

Hi Mike,

Can you post the exact code you're using and a description of the table with field names and types






Re: ERROR in VFPOLEDB.1 (Moved thread)

CetinBasoz

It is the same as yours and it doesn't work Then are you sure that you have VFPOLEDB installed on your system