【发布时间】:2015-03-27 06:52:41
【问题描述】:
执行时我面临的以下查询:
IErrorInfo.GetDescription 失败,出现 E_FAIL(0x80004005)。
连接 MS Access 数据库。当我在 SQL Server 中执行相同操作时,它可以正常工作,但不能用于 MS Access 数据库。任何人都可以帮助解决这个问题。
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
【问题讨论】:
-
这不是有效的 Access SQL(不支持
case语句)如果在修复查询后错误仍然存在,您需要在代码中显示错误发生的位置; is it possible to using select case statement in access query? -
0x80004005 通常表示访问被拒绝...