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

提示出错,非法赋值?
是这样的,代码如下:
<%
set   rsCheck   =   Server.CreateObject( "adodb.recordset ")
sqlCheck   =   "select   top   1   title,username   from   yfindex   where   subid   =   ' "&rs1( "subid ")& " '   order   by   initime   desc   "   ----   125行


rsCheck.open   sqlCheck,conn,1,1
if   not   rsCheck.eof   then
%>
<td   align= "center "   valign= "middle "   bgcolor= "#FFFFFF "   style= "word-wrap:break-word; "> <%=rsCheck( "title ")%> <br> 发贴者: <%=rsCheck( "username ")%> </td> -->
<%else%>
<td   align= "center "   valign= "middle "   bgcolor= "#FFFFFF "   style= "word-wrap:break-word; "> <%   Response.Write( "暂无发表主题! ")%> </td>
        <%end   if%>

在这段代码前,还有:
  <%   set   rs1=Server.Createobject( "ADODB.Recordset ")
      rs1.open   "select   *   from   suboard   where   bid= "&rs( "bid ")& "   order   by   paixu ",conn,1,3      
      do   while   not   rs1.eof
    %>
    <tr   height= "30 ">
        <td   align= "center "   valign= "middle "   bgcolor= "#FFFFFF "> <%   if   isNew(rs1( "subid "))   =   1   then   %> <img   src= "../images/index_43.jpg "   width= "20 "   height= "19 "> <%else%> <img   src= "../images/index_46.jpg "   width= "20 "   height= "19 "> <%end   if%> </td>
        <td   align= "center "   valign= "middle "   bgcolor= "#FFFFFF "> <a   href= "main_test.asp?bid= <%=   rs1( "bid ")   %> &subid= <%=   rs1( "subid ")   %> "> <strong> <%=rs1( "suboard ")%> </strong> </a> </td>
函数isNew()如下:
Function   isNew(subid)  
Dim   sql
sql   =   "select   *   from   yfindex   where   subid   = "&   subid   & "   and   Day(initime)   > =Day(getdate()) "
set   rsIsNew   =   Server.CreateObject( "adodb.recordset ")
rsIsNew.open   sql,conn,1,1
if   rsIsNew.eof   then
isNew=0
Else
isNew=1
End   If
End   Function

运行后提示我出错:出错信息
Microsoft   VBScript   运行时错误   (0x800A01F5)
非法赋值:   'sqlcheck '
/csover/21/index.asp,   第   125   行


------解决方案--------------------
你把sqlcheck 输出看一下 response.write sqlcheck
------解决方案--------------------
如果
rs1.open "select * from suboard where bid= "&rs( "bid ")& " order by paixu ",conn,1,3
没有记录
sqlCheck = "select top 1 title,username from yfindex where subid = ' "&rs1( "subid ")& " ' order by initime d