Problems connecting to Outlook

C

Courtenay

Hi,

I'm trying to connect an Access 2002 DB to Outlook 2002.

I've been to http://www.slipstick.com/dev/database.htm
and have tried implementing the code from the Microsoft
Knowledge Base article "ACC2000: How to Retrieve Exchange
and Outlook Data with the Jet 4.0 OLE DB Provider" found
at: http://support.microsoft.com/?kbid=275262


When I attempt to run the sub I get a Run Time error and
it says: "MAPI folder or address book not found". Does
anyone know what I need to do to fix this problem?

Could it have something to do with using Access 2002
instead of 2000 as the article is based on?

The only change I made to the code is to replace the name
of the profile in the example to "Outlook" (See below for
the exact code I'm running)

Thanks,

Courtenay



Sub OpenExchange_Calendar()
Dim ADOConn As ADODB.Connection
Dim ADORS As ADODB.Recordset
Dim strConn As String

Set ADOConn = New ADODB.Connection
Set ADORS = New ADODB.Recordset

With ADOConn
.Provider = "Microsoft.JET.OLEDB.4.0"
.ConnectionString = "Exchange 4.0;" _
& "MAPILEVEL=Mailbox -
Outlook|;" _
& "PROFILE=MS Exchange
Settings;" _

& "TABLETYPE=0;DATABASE=C:\WINDOWS\Temp\;"
.Open
End With

With ADORS
.Open "Select * from Calendar", ADOConn,
adOpenStatic, _
adLockReadOnly
.MoveFirst
Debug.Print ADORS(3).Name, ADORS(3).Value
Debug.Print ADORS(10).Name, ADORS(10).Value
.Close
End With

Set ADORS = Nothing
ADOConn.Close
Set ADOConn = Nothing

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top