我写了一个 R 函数,它太长了,即使在memo
字段中也无法存储。如果我将它存储在硬盘驱动器某处的 txt 文件中,可能有一种读取方法。但是我可以将这个txt文件保存在附件字段中并用vb代码阅读吗?到目前为止,我得到的最接近的答案如下打印附件的名称,而不是附件中的名称。
Dim dbs As DAO.Database
Dim rst As DAO.Recordset2
Dim rsA As DAO.Recordset2
Dim fld As DAO.Field2
'Get the database, recordset, and attachment field
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblAttachments")
Set fld = rst("Attachments")
'Navigate through the table
Do While Not rst.EOF
'Print the first and last name
Debug.Print rst("FirstName") & " " & rst("LastName")
'Get the recordset for the Attachments field
Set rsA = fld.Value
'Print all attachments in the field
Do While Not rsA.EOF
Debug.Print , rsA("FileType"), rsA("FileName")
'Next attachment
rsA.MoveNext
Loop
'Next record
rst.MoveNext
Loop