I am trying to create a link in access 2007 to a passworded mailbox on the exchange server. I was using the linked table wizard on my inbox, but that specifies the link location as a file on my computer, and this needs to work across a network...
I am trying to create a link in access 2007 to a passworded mailbox on the exchange server.
I was using the linked table wizard on my inbox, but that specifies the link location as a file on my computer, and this needs to work across a network of users.
I found this link which seems to be exactly what I need, but is in reference to Office 2000:
http://msdn.microsoft.com/en-us/library/aa164914.aspx
I don't really understand whats going on with it and so don't know if it doesn't work because it is in reference to office 2000 or because of some other problems.
Here is the code I'm using, which should specify subfolder "New Folder" in the inbox
Public Function link()
CreateLinkedExternalTable "F:\Email Database\database.accdb", "Exchange 4.0;MAPILEVEL=Mailbox - Company name|Inbox;TABLETYPE=0;" & "DATABASE=F:\Email Database\database.accdb;", "New Folder", "LinkedExchange"
End Function
__________________________________________________ ____________
Sub CreateLinkedExternalTable(strTargetDB As String, _
strProviderString As String, _
strSourceTbl As String, _
strLinkTblName As String)
Dim catDB As ADOX.Catalog
Dim tblLink As ADOX.Table
Set catDB = New ADOX.Catalog
' Open a Catalog on the database in which to create the link.
catDB.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strTargetDB
Set tblLink = New ADOX.Table
With tblLink
' Name the new Table and set its ParentCatalog property to the
' open Catalog to allow access to the Properties collection.
.Name = strLinkTblAs
Set .ParentCatalog = catDB
' Set the properties to create the link.
.Properties("Jet OLEDB:Create Link") = True
.Properties("Jet OLEDB:Link Provider String") = strProviderString
.Properties("Jet OLEDB:Remote Table Name") = strLinkTbl
End With
' Append the table to the Tables collection.
catDB.Tables.Append tblLink
Set catDB = Nothing
End Sub
I get an unrecognized database format error, suggesting the .accdb could be the problem.
I've also used a blank .mdb test database, changing the code above to that file of course and get run-time error 3001:
"Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another." at this line:
.Name = strLinkTblAs
Any guidance is much appreciated.
Thanks
Gudzy