是否可以在 .Net 应用程序中读取 Paradox 7.x .db 文件?
我正在尝试在 .Net 3.5 应用程序中读取 Paradox 7.x .db 文件,但没有成功。
首先,当我将 odbc 注册为用户或系统 dsn 时,Microsoft Paradox ODBC 驱动程序仅显示最高 5.x 的版本,因此看起来它不支持 Paradox 版本 7.x。
在 connectionsstrings.com 我找到了应该与 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
但是,当我尝试使用数据适配器测试连接时,出现以下异常:
“错误 [IM002] [Microsoft][ODBC 驱动程序管理器] 未找到数据源名称且未指定默认驱动程序”
我已将 ODBC 指定为用户DSN 和系统 DSN 也是如此,但不断收到相同的错误。
关于我应该做什么的任何线索?
谢谢,
佩德罗
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
http: //www.progware.org/Blog/post/Connecting-to-a-PARADOX-DB-with-C-%28Vista-XP%29.aspx
和
http://www.progware.org/Blog/post/Connecting-to-a-PARADOX-DB-with-C-%28Vista-XP%29.aspx
and
好奇,为什么不使用 OLEDB 提供程序,然后使用 System.Data.OleDb 名称空间中的类?
Curious, why not use the OLEDB provider and then use the classes in the System.Data.OleDb namepsace?
这是我过去编写的一段代码,它可以工作。 它基于 Przemysław Staniszewski 在本线程其他地方的帖子中现已失效的链接中的代码。
它使用 OleDbConnection 和 OleDbDataAdapter 打开一个 Paradox 数据库文件,并将该文件的内容加载到 DataTable 变量中。
这段代码适用于我,用于紧急的一次性作业,并且缺乏错误处理。 也许对你有用。
Here is a piece of code I've worked on in the past that will work. It is based on code from the now dead link in Przemysław Staniszewski's post elsewhere in this thread.
It opens a paradox database file using and OleDbConnection and OleDbDataAdapter, and loads the contents of that file into a DataTable variable.
This code works for me, and was used for a rushed oneshot job, and lacks error handling. It maybe of use to you.