ASP.NET:“找不到可安装的 ISAM”尝试读取 dBASE IV 文件时出现异常
我需要在 ASP.NET 应用程序中打开并读取 Dbase 文件。当我尝试打开连接时,出现异常“无法找到可安装的 ISAM”。我已经尝试了这个问题中的最佳答案中的解决方案,但他们确实不适合我。
数据文件的文件路径是C:\dev\DATA.DBF。这是我用来尝试打开连接的代码:
Dim connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\dev\DATA.DBF;Extended Properties=dBASE IV;"
Dim connection As OleDbConnection = New OleDbConnection(connectionString)
connection.Open()
此时我收到异常“无法找到可安装的 ISAM”。你有什么想法我可以尝试让它发挥作用吗?请注意,我可以将此文件作为 dBASE IV 文件导入到 Access 数据库中。
我在 Windows 7 上运行 Visual Studio 2008。如果您需要更多信息,请告诉我。感谢您的帮助。
I need to open and read a Dbase file in my ASP.NET application. When I try to open the connection, I am getting the exception "Could not find installable ISAM." I have tried the solutions in the top answer in this question, but they did not work for me.
The filepath of the data file is C:\dev\DATA.DBF. Here is the code I am using to try to open the connection:
Dim connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\dev\DATA.DBF;Extended Properties=dBASE IV;"
Dim connection As OleDbConnection = New OleDbConnection(connectionString)
connection.Open()
At this point I get the exception "Could not find installable ISAM." Do you have any ideas what I can try to get this to work? Note that I am able to import this file into an Access database as a dBASE IV file.
I am running Visual Studio 2008 on Windows 7. Let me know if you need any more information. Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经找到了解决这个问题的方法。我使用了这篇文章中概述的技术。
我使用 ODBC 连接而不是 OLE 连接。代码如下:
请注意,DBF 文件的目录名位于连接字符串中,而 DBF 文件的完整路径位于 select 语句中。我只是遵循链接帖子中的约定,它对我有用。
I have found a solution to this problem. I used the technique outlined in this post.
I am using an ODBC connection instead of an OLE connection. Here is the code:
Note that the directory name of the DBF file is in the connection string, while the full path of the DBF file is in the select statement. I simply followed the convention in the linked post, and it worked for me.