在Access中更新ODBC链接字段 [英] Updating ODBC Linked Fields in Access

查看:89
本文介绍了在Access中更新ODBC链接字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用ODBC到SQL Server 2012更新绑定到链接表的Access 2010中的字段时遇到了很多麻烦。

I am having a lot of trouble updating fields in Access 2010 that are bound to linked tables using ODBC to SQL Server 2012.

由于各种原因,我必须使用硬编码查询更新某些字段。 重新查询和/或刷新这些字段非常困难。 我经常得到一条数据已经改变的错误信息。 当查询更改了下划线数据时,field.requery似乎不适用于ODBC表
。 我从来没有遇到本地Access表的这个问题,但不幸的是没有回头。

Some fields I have to update using hard coded queries for various reasons.  It's very difficult to requery and/or refresh those fields.  I often get a data has changed error message.  The field.requery does not seem to work with ODBC tables when the underling data has been changed by query.  I never had this issue with native Access tables but unfortunately there is no going back.

有没有一个很好的方法来处理这个?

Is there a good methodology to handle this?

推荐答案

你一般不应该有这样的问题。

You in general should not have such issues.

这里最经常解决这个问题的"技巧"是:

The "trick" here that most often fixes this issue is:

确保表具有主键。 (你可能已经有了这个)。

Ensure that the table has a primary key. (you likely have this already).

如果表有位(是/否)列,那么请确保将这些列的默认值设置为0。

If the table has bit (yes/no) columns, then make sure you set the default for such columns as 0.

并且还包括表格中有一个时间戳列真的有帮助。

And also including a have a timestamp column in the table really helps this.

如果/当你对表格进行任何此类更改时,那么你想重新链接你的表。

If/when you make any such changes to tables, then you want to re-link your tables.

请检查以上3个可能的问题。一旦你完成了上面的分类,那么你的桌子真的应该像在本地一样工作。

So check the above 3 possible issues. Once you have above sorted out then your tables really should work as if they are local.

问候,

Albert D. Kallal(访问MVP)

加拿大艾伯塔省埃德蒙顿

Regards,
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada


这篇关于在Access中更新ODBC链接字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆