如何使用 C# 操作 .dbf 文件?
我正在尝试这样的事情:
string pathFiles = Path.Combine(Application.StartupPath, "DB");
string strconn = "Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;" +
"Dbq="+pathFiles+";";
OdbcConnection odbconn = new OdbcConnection(strconn);
odbconn.Open();
我得到了这个异常
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
问题是相同的代码在windiws XP、Visual Studio 2010、Office 2007上运行正常,但在Windows 7 64位、Visual Studio 2008、Office 2010上不起作用。 我真的不知道有什么区别,我是赢得7的新手。 一些提示会很棒。谢谢。
I am trying to something like this:
string pathFiles = Path.Combine(Application.StartupPath, "DB");
string strconn = "Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;" +
"Dbq="+pathFiles+";";
OdbcConnection odbconn = new OdbcConnection(strconn);
odbconn.Open();
and i get this exception
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
The problem is that the same code runs ok on windiws XP , visual studio 2010, office 2007 and it doesn't work on windows 7 64bit , visual studio 2008,office 2010.
I really don't know whatvis the difference, i am new to win 7.
Some tips would be great.Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不管怎样,我在 Vista 和 Windows 7 上使用以下连接来操作 dBase 文件。我仍然将目标输出设置为 x86。
输出文件夹名称就是我要写入或读取的 DBase 文件所在的目录。
For what it is worth, I manipulate dBase files using the following connection on Vista and Windows 7. I still set the target output as x86.
The output folder name is just the directory where the DBase files that I'm either writing to or reading from.