求救~~asp,access数据库连接查询问题
Set rs=Server.CreateObject( "ADODB.RecordSet ")
sql= "select bigtype.bigname,* from pic
left join bigtype on bigtype.id=pic.bigtype
rs.Open sql,conn,1,1
上面这个是能正常运行的,但我再加一个表:
Set rs=Server.CreateObject( "ADODB.RecordSet ")
sql= "select smalltype.smallname,bigtype.bigname,* from pic
left join bigtype on bigtype.[id]=pic.bigtype
left join smalltype on smalltype.smallid=pic.smalltype "
rs.Open sql,conn,1,1
这样就出问题了,报错:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21 '
ODBC 驱动程序不支持所需的属性。
sql语句在查询分析器里能运行,应该是哪里出问题了呢?
------解决方案--------------------sql= "select * from pic left join bigtype on bigtype.id=pic.bigtype left join smalltype on smalltype.id=pic.smalltype "
------解决方案--------------------刚才打错:
select smalltype.smallname,bigtype.bigname,* from ( pic
left join bigtype on bigtype.[id]=pic.bigtype )
left join smalltype on smalltype.smallid=pic.smalltype
如果还不行,就检查一下你的单词有没有错