如何使用 VBA 搜索 Lotus 文档

发布于 2024-09-30 04:40:52 字数 659 浏览 6 评论 0原文

我需要从 Lotus 表单中获取 3 个特定字段并放入静态 Access 表中,我可以从中执行更多查询(其中 2 个字段作为主键,以便我可以将第三个字段与其他内容连接起来)。在下面的伪代码中,我充实了一个函数来做到这一点,但我无法弄清楚细节(我认为如果没有正式培训,我永远不会理解 Lotus 的工作原理)。请帮我完成这个程序?

Function GetFromLotusDocs() As String
    Dim NtS As New NotesSession
    Dim NtDb As New NotesDatabase
    Dim NtF As New NotesForm
    NtS.Initialize
    Set NtDb = NtS.GetDatabase("MyServer", "MyDB.nsf")
    Set NtF = NtDb.GetForm("MyForm")

    For each document in NtDB
        DoCmd.RunSQL _
        "INSERT INTO TmpTbl ( Fld1,Fld2,Fld3 ) SELECT " & _
        Fld1 & "," & Fld2 & "," & Fld3 & ";"    
    Next document
End Function

I need to get 3 specific fields out of a Lotus form and into a static Access table from which I can do more queries (2 of those fields make a primary key so i can join the 3rd with other stuff). In the pseudo-code below, I've fleshed out a function to do just that, but I can't figure out the details (I don't think I'll ever understand how Lotus works without formal training). Please help me finish this procedure?

Function GetFromLotusDocs() As String
    Dim NtS As New NotesSession
    Dim NtDb As New NotesDatabase
    Dim NtF As New NotesForm
    NtS.Initialize
    Set NtDb = NtS.GetDatabase("MyServer", "MyDB.nsf")
    Set NtF = NtDb.GetForm("MyForm")

    For each document in NtDB
        DoCmd.RunSQL _
        "INSERT INTO TmpTbl ( Fld1,Fld2,Fld3 ) SELECT " & _
        Fld1 & "," & Fld2 & "," & Fld3 & ";"    
    Next document
End Function

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

洒一地阳光 2024-10-07 04:40:52

如果您只需要从 Notes 获取数据并导入 Access,我建议安装和配置 Lotus Notes SQL 驱动程序。我曾多次使用它来将数据提取到 Access 中,通常是为了让我在将数据移至 SQL 或 SQL Express 数据库之前对其进行清理。

链接如下: http://www.ibm.com/developerworks/lotus/产品/notesdomino/notessql/

If you just need to get data out of Notes and into Access, I suggest installing and configuring the Lotus Notes SQL driver. I've used it many times to pull data into Access, usually to allow me to clean it up before moving it to a SQL or SQL express database.

Here's the link: http://www.ibm.com/developerworks/lotus/products/notesdomino/notessql/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文