简体   繁体   English

SQL Server 后端访问前端 ODBC 错误

[英]SQL Server BackEnd Access Front-End ODBC Error

I can read/write/update the table fine in SSMS, I can open/read/write the table fine if I open the table itself in Access 2013, but if I try to query the table, I get the generic access error message of我可以在 SSMS 中很好地读/写/更新表,如果我在 Access 2013 中打开表本身,我可以很好地打开/读/写表,但是如果我尝试查询表,我会收到通用访问错误消息

ODBC -- call failed ODBC -- 调用失败

This table has 558,672 rows in it.该表中有 558,672 行。 I have tried using a DSNLess connection with VBA as well as a manually linking the table in through the toolbar in access.我曾尝试使用与 VBA 的 DSNLess 连接以及通过访问中的工具栏手动链接表格。 What is causing access to throw this error?是什么导致访问抛出此错误?

EDIT编辑
I have also tried to compact and repair the database to no avail.我也尝试过压缩和修复数据库无济于事。

EDIT #2编辑#2
It seems that only one element (a subform) is throwing the ODBC error.似乎只有一个元素(子窗体)抛出 ODBC 错误。 The peculiar thing is the main form is based on the same datasource that the sub form is, but only the subform is throwing an error?奇怪的是主表单基于与子表单相同的数据源,但只有子表单抛出错误?

I had this problem before here are the thing I had to change to access table with MS Access and edit it.我之前遇到过这个问题,这是我必须更改才能使用 MS Access 访问表并对其进行编辑的事情。

1.your tables should have a primary key. 1.你的表应该有一个主键。 In the column properties, set identity specification to yes, and Identity increment by 1. I would prefer to set a completely new column with int data type.在列属性中,将标识规范设置为是,并将标识递增 1。我更愿意设置一个具有 int 数据类型的全新列。 2. No null values in boolean fields everything should be 1 or 0. and set a constraint to 0. 2. 布尔字段中没有空值,一切都应该是 1 或 0。并将约束设置为 0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM