Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 17th, 2004, 07:33 AM
Registered User
 
Join Date: Jun 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default need code to attach Access table to Lotus Notes

Somebody told me that Access has the capability to attach a table to Outlook, but they weren't sure how to do it. I was wondering if it has the same capability to attach a table to Lotus notes as the last function of a macro or even in a module. I am using Access 97. Does anybody have any ideas?
 
Old June 18th, 2004, 02:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

First, you need to downlaod:

Lotus NotesSQL 3.0.2e for Wintel32 US English
Windows 2000, Windows 95, Windows 98, Windows NT:

http://www.lotus.com/products/rnext....5?OpenDocument

This is the ODBC Driver needed to integrate Lotus Notes and Access. It may already be installed on your system. Check:

Start -> Administrative Tools -> Data Sources(ODBC)

The ODBC Data Source Administrator dialog should open. Click the "Drivers" tab and look for the "NotesSQL" driver.

Second, use the ODBC Data Source Administrator to Create a New Data Source (File DSN).

Third, go into Access:

File -> External Data -> Link Tables

In the Link dialog, navigate to C:\Program Files\Common Files\ODBC\Data Sources (the default folder in which ODBC Data Source files are stored)

In the Files of Type drop down list, select ODBC Databases()

The Select Data Source Dialog will appear listing your LotusNotes File Data Source. Select it.

A Link Tables dialog will appear listing the Notes tables you can link to.

I don't have Access to Lotus Notes at the moment, but I bet that'll get it for you.

HTH,

Bob


 
Old June 18th, 2004, 02:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Here's somthing close to the code to do it (untested):


' Call CreateLinkedExternalTable("FILEDSN=C:\Program Files\Common Files\ODBC\Data Sources\LotusNotes.dsn","tblData")

Sub CreateLinkedExternalTable(ByVal strConnect As String, _
                              ByVal strSourceTbl As String, _
                              Optional ByVal strLinkTblName As String)


    Dim catDB As ADOX.Catalog
    Dim tblLink As ADOX.Table

    Set catDB = New ADOX.Catalog
    catDB.ActiveConnection = CurrentProject.Connection

    If strLinkTblName = "" Then
        strLinkTblName = strSourceTbl
    End If

    Set tblLink = New ADOX.Table
    With tblLink
        .Name = strLinkTblName
        Set .ParentCatalog = catDB
        .Properties("Jet OLEDB:Create Link") = True
        .Properties("Jet OLEDB:Link DataSource") = strConnect
        .Properties("Jet OLEDB:Remote Table Name") = strSourceTbl
    End With

    With catDB.Tables
        On Error Resume Next
        .Append tblLink
        .Refresh
    End With
    Set catDB = Nothing
End Sub

A Full ODBC File DSN connection string that ADO can use looks like:

oConn.Open "FILEDSN=c:\somepath\mydb.dsn;" & _
           "Uid=myUsername;" & _
           "Pwd=myPassword"

HTH,

Bob






Similar Threads
Thread Thread Starter Forum Replies Last Post
Email Via Lotus Notes poyserr Access 1 June 30th, 2009 04:05 PM
Issue with Lotus Notes Warbird VB How-To 1 November 13th, 2007 01:06 PM
Sending email using Lotus Notes S.A.M Excel VBA 5 August 23rd, 2007 07:10 AM
Integrating Lotus notes with .net vivek_inos ASP.NET 2.0 Professional 2 June 12th, 2007 04:52 AM
Lotus Notes GuyB ASP.NET 1.0 and 1.1 Basics 0 December 27th, 2005 07:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.