Is it possible to read to a Paradox 7.x .db file i

2019-07-09 02:13发布

问题:

I'm trying to read a Paradox 7.x .db file in a .Net 3.5 app and I'm not being successful on that.

First of all, when I'm registering the odbc, as a user or system dsn, the Microsoft Paradox ODBC Driver only display versions up to 5.x, so it looks like that it does not support Paradox version 7.x.

At connectionsstrings.com I've found the connection string that is supposed to work with Paradox 7.x:

Provider=MSDASQL;Persist Security Info=False;Mode=Read;
Extended Properties='DSN=Paradox;DBQ=C:\mydbfolder;
DefaultDir=C:\mydbfolder;DriverId=538;FIL=Paradox 7.X;MaxBufferSize=2048;
PageTimeout=600;';Initial Catalog=C:\mydbfolder

But when I try to test the connection using a Data Adapter I get the following exception:

"ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"

I have specified the ODBC as a user DSN and as a System DSN as well but kept receiving the same error.

Any clues on what should I do?

Thanks,

Pedro

回答1:

http://www.progware.org/Blog/post/Connecting-to-a-PARADOX-DB-with-C-%28Vista-XP%29.aspx

and

ConnectionString.Append(@"Provider=Microsoft.Jet.OLEDB.4.0;");
ConnectionString.Append(@"Extended Properties=Paradox 7.x;");
ConnectionString.Append(@"Data Source=Z:\Dane;");
//ConnectionString.Append(@"Mode=ReadWrite;");
ConnectionString.Append(@"Mode=1;");


回答2:

Curious, why not use the OLEDB provider and then use the classes in the System.Data.OleDb namepsace?



标签: c# odbc paradox