I use an Access database used just as back end.
I use some Memo Fields.
我使用Access数据库作为后端。我使用了一些备注字段。
I have learnt that Memo Fields are subject to cause database corruption because they are stored in a separate data page; the record only holds a pointer to the data page where the actual data is stored.
我了解到备注字段会导致数据库损坏,因为它们存储在单独的数据页中;记录仅保存指向存储实际数据的数据页的指针。
Most of the time I just need from 100 to 1000 chars or so, so I had an idea...
My "brilliant" (or not) idea was to split the memo into 4 or 5 Text Field's (they can hold 255 chars each).
大多数时候我只需要100到1000个字符,所以我有一个想法......我的“精彩”(或不是)想法是将备忘录分成4或5个文本字段(它们每个可以容纳255个字符) )。
Anyone has done this before?
Any known issues?
Would this approach be less prone to data corruption?
以前有人这样做过吗?任何已知的问题?这种方法是否更不容易出现数据损坏?
Thanks,
Jag
P.S.
1. I have had corruption issues before.
2. I know the best thing would be to migrate to another back end, but it isn't possible.
附:我以前遇到过腐败问题。 2.我知道最好的办法是迁移到另一个后端,但这是不可能的。
2 个解决方案
#1
The better workaround is to unbundle the memo data page from its attached record. The way to do that is to put the memo field(s) in a separate table. You can either do it with a 1:1 table (with multiple memos in the side table), or, better, as a 1:N table with a memo type field. The latter way is the only way to completely avoid the memo pointer problem, though, as in the former solution, the corruption of any memo pointer in the memo table causes you to lose all of them.
更好的解决方法是从其附加记录中解开备忘录数据页面。这样做的方法是将备注字段放在单独的表中。您可以使用1:1表格(在边桌中有多个备忘录),或者更好,作为带有备忘录类型字段的1:N表格。后一种方法是完全避免备忘录指针问题的唯一方法,但是,在前一种解决方案中,备忘录表中任何备忘录指针的损坏都会导致丢失所有备忘录指针。
Also, you should consider why your database is corrupting memo pointers. Aside from the suggestion above, you should probably consider editing your memos unbound, though since it doesn't seem you are using an Access front end to your Jet MDB that is probably not an issue. I see memo corruption every now and again, but not very often. If you see it often, it suggests to me that your application is badly designed or your operating environment is markedly substandard.
此外,您应该考虑数据库损坏备忘录指针的原因。除了上面的建议,您可能应该考虑编辑未绑定的备忘录,但是因为您似乎没有使用可能不是问题的Jet MDB的Access前端。我不时地看到备忘录腐败,但不是经常。如果您经常看到它,它会告诉我您的应用程序设计糟糕或您的操作环境明显不合标准。
#2
It sounds like you want to take an existing memo field and chop-up before putting it into the database and then gluing it back together when you need to display it.
听起来你想要将现有的备忘录字段和切入之前放入数据库,然后在需要显示它时将其粘合在一起。
I think you are going to be in for a world of pain if you try that. I'd try harder to change the backend if that was your only option :)
如果你尝试的话,我想你会陷入痛苦的世界。如果那是你唯一的选择,我会更加努力地改变后端:)
I'll build on DWF's answer by suggesting doing something like you were suggesting. Make a 1:N table (I'll call it UserNotes) with a text field (vs the memos that you seem to be having troubles with).
我将通过建议做一些你建议的事情来建立DWF的答案。使用文本字段创建1:N表(我将其称为UserNotes)(与您似乎遇到麻烦的备忘录相比)。
Then create a subform with UserNotes as its record source, and replace the memo field with the UserNotes subform. This lets the user decide where line/paragraph breaks are within the context of the 255 character text field. (for conversion you'll still have to chop the memos up, but that's just a one time operation)
然后创建一个以UserNotes作为记录源的子表单,并用UserNotes子表单替换备注字段。这允许用户决定在255个字符文本字段的上下文中行/段落的位置。 (对于转换,你仍然需要打开备忘录,但这只是一次性操作)
#1
The better workaround is to unbundle the memo data page from its attached record. The way to do that is to put the memo field(s) in a separate table. You can either do it with a 1:1 table (with multiple memos in the side table), or, better, as a 1:N table with a memo type field. The latter way is the only way to completely avoid the memo pointer problem, though, as in the former solution, the corruption of any memo pointer in the memo table causes you to lose all of them.
更好的解决方法是从其附加记录中解开备忘录数据页面。这样做的方法是将备注字段放在单独的表中。您可以使用1:1表格(在边桌中有多个备忘录),或者更好,作为带有备忘录类型字段的1:N表格。后一种方法是完全避免备忘录指针问题的唯一方法,但是,在前一种解决方案中,备忘录表中任何备忘录指针的损坏都会导致丢失所有备忘录指针。
Also, you should consider why your database is corrupting memo pointers. Aside from the suggestion above, you should probably consider editing your memos unbound, though since it doesn't seem you are using an Access front end to your Jet MDB that is probably not an issue. I see memo corruption every now and again, but not very often. If you see it often, it suggests to me that your application is badly designed or your operating environment is markedly substandard.
此外,您应该考虑数据库损坏备忘录指针的原因。除了上面的建议,您可能应该考虑编辑未绑定的备忘录,但是因为您似乎没有使用可能不是问题的Jet MDB的Access前端。我不时地看到备忘录腐败,但不是经常。如果您经常看到它,它会告诉我您的应用程序设计糟糕或您的操作环境明显不合标准。
#2
It sounds like you want to take an existing memo field and chop-up before putting it into the database and then gluing it back together when you need to display it.
听起来你想要将现有的备忘录字段和切入之前放入数据库,然后在需要显示它时将其粘合在一起。
I think you are going to be in for a world of pain if you try that. I'd try harder to change the backend if that was your only option :)
如果你尝试的话,我想你会陷入痛苦的世界。如果那是你唯一的选择,我会更加努力地改变后端:)
I'll build on DWF's answer by suggesting doing something like you were suggesting. Make a 1:N table (I'll call it UserNotes) with a text field (vs the memos that you seem to be having troubles with).
我将通过建议做一些你建议的事情来建立DWF的答案。使用文本字段创建1:N表(我将其称为UserNotes)(与您似乎遇到麻烦的备忘录相比)。
Then create a subform with UserNotes as its record source, and replace the memo field with the UserNotes subform. This lets the user decide where line/paragraph breaks are within the context of the 255 character text field. (for conversion you'll still have to chop the memos up, but that's just a one time operation)
然后创建一个以UserNotes作为记录源的子表单,并用UserNotes子表单替换备注字段。这允许用户决定在255个字符文本字段的上下文中行/段落的位置。 (对于转换,你仍然需要打开备忘录,但这只是一次性操作)