System.Data.OleDb.OleDbException:定义了太多字段
我正在构建一个 .NET WinForms 应用程序来替换 Microsoft Access(此处插入集体抱怨)数据库中的一系列表单。 为了完成初始版本,我尝试使用现有查询,而不是深入研究数据模型及其明显的设计问题。
我使用 OleDbCommand 对象调用查询并将它们视为存储过程。 这在我们用来测试办公室应用程序的工作站上运行良好,但在客户端计算机上运行时会失败,并出现“System.Data.OleDb.OleDbException:定义的字段太多”错误。 两个环境都运行 MS Access 2003,因此客户端计算机上的错误原因并不明显。
我在 http://www.eggheadcafe.com/conversation 找到了一个帖子.aspx?messageid=33475714&threadid=33453796 表示如果列数超过 127,就会发生这种情况。查询中使用的几个表的列数超过此数量(几乎完全缺少标准化,我知道)。 我相信这是原因,但无法解释为什么我们的办公室没有发生错误。 对于解决将数据访问拆分为多个查询的问题有什么建议吗?
I'm working on building a .NET WinForms application to replace a series of forms in a Microsoft Access (insert collective groan here) database. In an effort to get the initial version finished, I am attempting to use the existing queries rather than digging into the data model and its obvious design problems.
I'm calling the queries using the OleDbCommand object and treating them like stored procedures. This works fine on the workstations we've used to test the application in our office, but fails with a "System.Data.OleDb.OleDbException: Too many fields defined" error when run on the client's computer. Both environments are running MS Access 2003, so the cause of the error on the client's computer is not apparent.
I found a post at http://www.eggheadcafe.com/conversation.aspx?messageid=33475714&threadid=33453796 that says this can happen if the number of columns exceeds 127. A couple of the tables being used in the queries have more than this number of columns (almost a complete lack of normalization, I know). I believe this is the cause, but can't explain why the error does not occur in our office. Any suggestions for resolving this short of splitting the data access into multiple queries?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不明白为什么会发生这种情况。
但是,这可能与您的办公室与客户端计算机中安装的 MDAC 组件有关(即 MDAC 组件包括 JET oledb 驱动程序)。
这可能会有所帮助。
I do not have understanding of why this could be occurring.
However, this could be related to MDAC components installed in your office vs client computer (i.e MDAC components include JET oledb driver).
This might help.