如果更改位于“备注"类型的字段中,则保存更改行时出错 [英] Error on Save a changed row if the change was in a field of type 'Memo'

查看:73
本文介绍了如果更改位于“备注"类型的字段中,则保存更改行时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在SQL服务器上有一个带有链接(odbc)表的Access-db.有时,特定行的一列会出现一个罕见的问题:备注类型字段中无法再进行任何更改. 此特定行的其他列中的更改将照常保存. 错误消息味精类似于:另一个应用程序更改了行,因此更新已取消.

We have a Access-db with linked (odbc) tables on an sql-server. Some times there is a rare problem with one column of a particular row: no more changes in the field of type memo are possible. Changes in other columns of this particular rows are saved as normal. The error-msg goes something like: annother application has changed the row and therefor the update has been canceled.

可能是什么原因,可以采取什么措施来防止这种行为?

what could be the reason, what can be done to prevent this behaviour?

和平 冰

更新:

mdb绝对没有损坏.里面只有odbc连接,我们以只读模式使用它.问题一定是在喷气发动机和odbc驱动程序分别为sql-server之间,这就是我的想法.

The mdb is definitively not corrupt. There are only the odbc-connections inside, we use it in read-only mode. The issue must be between the jet-engine and the odbc-driver respective the sql-server, that is what i think.

和平

推荐答案

如果您的数据存储在Jet/ACE后端,则可能是您的备忘录指针已损坏.由于您的数据在SQL Server中,并且可以通过ODBC访问,所以这不是答案.但是由于其他人可能会在讨论中遇到Jet/ACE后端问题,因此以下内容可能会有所帮助:

If your data were stored in a Jet/ACE back end, I'd say you likely have a corrupted memo pointer. Since your data is in SQL Server and accessed via ODBC, that can't be the answer. But since others might come to this discussion who are encountering the problem with a Jet/ACE back end, the below might be helpful:

在Jet/ACE表中,备忘录数据未与其他字段内联存储.而是将数据存储在其他位置的单独数据页中,并且内联存储的所有内容都是指向第一个外部数据页的指针.该指针容易损坏,并且是导致数据丢失的常见原因.

In Jet/ACE tables, memo data is not stored inline with the the other fields. Instead, the data is stored in separate data pages elsewhere and all that is stored inline is a pointer to the first of the external data pages. That pointer is susceptible to corruption and is a frequent cause of lost data.

Tony Toews的某些链接(此链接的最佳来源):

Some links from Tony Toews (the best source for this):

Jet/ACE腐败的一般参考资料

腐败症状

在第二个中,搜索3197,这很可能是您遇到的问题的错误号.那里有一个链接,解释了如何解决它.

In that second one, search for 3197, which is likely the error number of the problem you're encountering. There's a link there that explains how to troubleshoot it.

修复它后,应该考虑重组数据表,以最大程度地减少备忘字段损坏的风险.

After you've fixed it, you should consider restructuring your data tables to minimize the risk of memo field corruption.

  1. 我知道您没有使用Access,但是对于Access表单,一种解决方案是避免绑定备注字段,而是在未绑定的文本框中进行编辑.在Access窗体的OnCurrent事件中,将备忘录数据从窗体的字段集合复制到它的未绑定文本框中,然后在文本框的AfterUpdate事件中,将其保存回窗体的基础记录集.

  1. I know you are not using Access, but for Access forms, one solution is to avoid bound memo fields, and instead edit them in unbound textboxes. In the Access form's OnCurrent event, you'd copy the memo data from the form's fields collection into the unbound textbox for it, and in the textbox's AfterUpdate event, save it back to the form's underlying recordset.

对于所有应用程序(无论是否具有访问权限),将备忘录放在单独的表中会将备忘录字段指针与其余数据区分开.如果您有一个备忘录,它可以是1:1表,而如果您有多个备忘录,则将具有1:N,备忘录表必须具有一个字段来指示备忘录类型.通过这种结构,不必删除主记录并重新创建主记录即可修复损坏的指针-您要做的就是删除备忘录表中的损坏记录.

for all applications, Access or not, putting the memos in a separate table segregates the memo field pointer from the rest of the data. If you have one memo, it can be a 1:1 table, and if you have multiple memos, you would have a 1:N and the memo table would have to have a field to indicate the memo type. With that structure, the main record does not have to be deleted and recreated to fix a corrupted pointer -- all you have to do is delete the corrupted record in the memo table.

这篇关于如果更改位于“备注"类型的字段中,则保存更改行时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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