accessing outlook calendar using ADO

S

steve

I have Outlook 2000 set for Internet email and want to access my calendar
items via ADO

I have found the code below from the MS site but I get the error "MAPI
folder or Address book not found"

I am using VB6

Any ideas
Steve

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 - Personal Folders|;" _
& "PROFILE=Microsoft Outlook Internet 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
 

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