So the following code worked beautifully in Access 2003. After upgrading to Office 2007, the code worked for about a week before I began getting the extremely helpful error message, "Unspecified Error". For some reason, whenever I got this error I could open the database in the old access 2003, and the library reference for Outlook 12.0 would show up missing. If I fixed the reference with the old Outlook 11.0 library, the database would suddenly start working again in both Access 2003 and 2007.
Then we decided to upgrade the database to a 2007 .accdb file, which means that I can't use that cheap fix any more.
Here's my code:
The 5-line Email.Open statement fails every time with the following:
Run-time error'-2147467259 (80004005)':
"Unspecified error"
HELP!!
Then we decided to upgrade the database to a 2007 .accdb file, which means that I can't use that cheap fix any more.
Here's my code:
Code:
Dim Emails As ADODB.Recordset
Set Emails = New ADODB.Recordset
Emails.CursorLocation = adUseClient
Emails.Open "SELECT [From], Subject, Received, Contents " & _
"FROM Inbox IN 'C:\Windows\Temp\;'" & _
"[Outlook 9.0;MAPILEVEL=Mailbox - macc compops|;]" & _
"WHERE InStr(Subject, '*LOG*') > 0;", _
CurrentProject.Connection, , , adCmdText
The 5-line Email.Open statement fails every time with the following:
Run-time error'-2147467259 (80004005)':
"Unspecified error"
HELP!!