0

Below query when I execute I am facing:

IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

to Connect MS Access dataBase. When I excute same in SQL Server its working but its not working for MS Access DataBase. Can any one help on this.

select [EmpName],EmpMaster.EmpCodeDisplay,Transactions.CardNo,
case when CONTROLLERS.ControllerName = 'Level0Entry' then 'Reception' when CONTROLLERS.ControllerName = 'LevelBCiscoNSNRx' then 'Basement' 
else CONTROLLERS.ControllerName end as ControllerName,aDateTime from Transactions 
inner join CONTROLLERS on Transactions.ControllerNo = CONTROLLERS.ControllerNo  
inner join EmpMaster on Transactions.EmpCode = EmpMaster.EmpCode 
where transactions.ControllerNo in ('7','9') and aDateTime between '1/28/2015 05:45:00.000' and '1/28/2015 23:59:00.000' 
and transactions.EmpCode <> '0'   and Transactions.CardNo in (select CardNo from Transactions 
where transactions.ControllerNo in ('7','9') and transactions.EmpCode <> '0' and aDateTime between '1/28/2015 05:45:00.000' and '1/28/2015 23:59:00.000' 
 group by Transactions.CardNo having COUNT(Transactions.CardNo) < 2 )  order by aDateTime asc
Alex K.
  • 171,639
  • 30
  • 264
  • 288
surendra
  • 1
  • 1
  • 1
    That is not valid Access SQL (No `case` statement support) If the error persists after fixing the query you need to show where in your code the error occurs; [is it possible to using select case statement in access query?](http://stackoverflow.com/questions/15774078/is-it-possible-to-using-select-case-statement-in-access-query) – Alex K. Jan 28 '15 at 11:32
  • 0x80004005 usually means access denied... – oɔɯǝɹ Jan 28 '15 at 11:42

1 Answers1

1

You can try using the SWITCH statement for MS Access

OR

the IIF

HansUp
  • 95,961
  • 11
  • 77
  • 135
Conrad Lotz
  • 8,200
  • 3
  • 23
  • 27