日期:2014-05-17  浏览次数:20800 次

请大家帮忙看看这个ACCESS的查询语句错在哪?
<%   set   rs=server.createobject( "adodb.recordset ")
TableName   =   DatePart( "m ",DateAdd( "m ",-1,Date))
sql= "select   a.dkhbh   as   dkhbh,a.dkhmc   as   dkhmc,SUM(b.money)   AS   money1,SUM(c.money)   AS   money2,SUM(d.money)   AS   money3   from   dkhinfo   as   a   LEFT   OUTER   JOIN   "&TableName& "qt   as   d   ON   a.dkhbh=d.dkhbh   LEFT   OUTER   JOIN   "&TableName& "adsl   as   c   ON   a.dkhbh=c.dkhbh   LEFT   OUTER   JOIN   "&TableName& "pstn   as   b   ON   a.dkhbh=b.dkhbh   order   by   a.dkhbh "
rs.open   sql,conn,1,1
%>

提示我ODBC驱动程序不支持所需的属性

------解决方案--------------------
response.write sql
response.end
看看输出的结果是什么?
------解决方案--------------------
ACCESS里连续的Outer Join应该这样写:
Select a.??,b.??,c.?? From ([tableA] a Left Outer Join [tableB] b on a.??=b.??) Left Outer Join [tableC] c on a.??=c.?? Where a.??=?? Order by a.?? Desc,b.?? Desc,c.?? Asc