Error when calling Union query in Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to call a query that uses a union in a Access 200
database, and I get the following error

"Unspecified error: E_FAIL(0x80004005)

I am pretty sure that it is because it is calling a query that has
union since all my other calls to queries in this database work okay.
Here is my code for the area where I make the call, early in the cod
I set cmdReporting.CommandType = Oledb.StoredProcedure

*************************************************************
cmdReporting.CommandText = "qryExceptionSummary

daFillData = Nothin
daFillData = New OleDb.OleDbDataAdapter(cmdReporting

'check if the table exists in the dataset
'if yes, then clear out the content of the tabl
If dsExceptionSum.Tables.Contains("qryExceptionSummary") The
dsExceptionSum.Tables("qryExceptionSummary").Clear(
End I

daFillData.Fill(dsExceptionSum, "qryExceptionSummary"
***************************************************************

I would think that ADO would call the query and run it like MS SQ
Server does with stored procedures, and the syntax in the query woul
not matter as long as it runs correctly. By the way, the query run
fine when I manually run it in Access

Thanks for any help you can provide

Bob
 
FYI....I ended up calling Microsoft on this, and the problem was that
I had the word "Exception" as one of my fields in this Union query.
That word is a Jet reserve word and cannot be used without brackets.
Here is a list of Jet reserve words:
http://support.microsoft.com/?id=248738.

Bob
 
Back
Top