Unspecified Error in SQL

Meegz23

New member
Local time
Today, 00:20
Joined
Jul 29, 2008
Messages
2
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:

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!!
 
I have absolutely no clue...but, I did notice the select statement is missing some spaces between clauses (where clause bumps up against connection info). Perhaps the older version(s)/drivers handled the lack of spaces and the new one don't?

Sorry, just grasping at straws.

Just curious, what happens when you paste that exact SQL into a query? Again, no clue and grasping at straws.
 
If I throw it in a Query, Access crashes. In fact, I just tried 2007's new 'import outlook inbox' deal, and it causes Access to crash as well.
 

Users who are viewing this thread

Back
Top Bottom