MS ACCESS:如何更新带有大文本的备注字段

MSACCESS: How to update a memo field with large text

我在 MS Access 2010 中有一个 memo 字段,我想在其中粘贴一大段文本(大约 160k 个字符)。

当我直接粘贴到 table 中时,出现 "the text is too long to be edited" 错误。 尝试通过表单执行此操作时会发生同样的事情。

我还尝试将文本保存到文件中,然后使用 VBA 读取文件内容,然后通过 运行 更新 table 更新 table sql 语句。在这种情况下,我收到运行时错误 3035 "System resource exceeded".

据此post我应该可以存储 1GB 的数据 否则我如何用我的文本更新备注字段?

您可以使用记录集更新字段。这样,您就不会超过更新查询的最大长度

(代码不完整,需要更多细节才能写出更准确的代码)

Dim str As String
'Read text file into str
Dim rs As DAO.RecordSet
Set rs = CurrentDb.OpenRecordset("MyTable")
rs.AddNew
rs.Fields("MyMemoField").Value = str
rs.Update
rs.Close