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

rs.eof rs.bof 一直为true
我把sql语句response.write出来直接运行都有数据,为什么这样就为空?而且好象rs确实没取到东西,因为rs.getrow也报错,请问是怎么回事?
Set   conn   =   server.createobject( "adodb.connection ")
conn.open   MM_inteheldb_STRING
Set   rs   =   server.CreateObject( "adodb.recordset ")
sqlstr   =   "Select   Exception_Desc.EXCEPTION_DESC,Exception_INFO.EXCEPTION_CAUSE,Exception_INFO.EXCEPTION_TIME   from   Exception_Desc,Exception_INFO   where   Exception_INFO.EXCEPTION_TIME   between   to_date( ' "   &   starttime   &   " ', 'YYYY-MM-DD   HH24:MI:SS ')   and   to_date( ' "   &   endtime   &   " ', 'YYYY-MM-DD   HH24:MI:SS ')   and   Exception_Desc.EXCEPTION_CODE   =   Exception_INFO.EXCEPTION_CODE "

rs.open   sqlstr,conn,3,3
response.write   rs.eof   &   "--- "&   rs.bof  


------解决方案--------------------
sqlstr = "Select Exception_Desc.EXCEPTION_DESC,Exception_INFO.EXCEPTION_CAUSE,Exception_INFO.EXCEPTION_TIME from (Exception_Desc inner join Exception_INFO on Exception_Desc.EXCEPTION_CODE = Exception_INFO.EXCEPTION_CODE) where Exception_INFO.EXCEPTION_TIME between to_date( ' " & starttime & " ', 'YYYY-MM-DD HH24:MI:SS ') and to_date( ' " & endtime & " ', 'YYYY-MM-DD HH24:MI:SS ') "