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

数据库问题的一个错误,急…在线等
数据库连接操作不执行,我的代码如下(有些长,不好意思):

<%  



shibie   =   Trim(Request.QueryString( "shibie "))

if   isNumeric(shibie)=false   or   shibie= " "   then
    shibie   =   0              
end   if

if   len(shibie) <> " "     then   %>
【 <a   href= "default.asp?shibie= "& <%=   shibie   %>   class= "xiah "> 类别管理 </a> 】             &nbsp;&nbsp;&nbsp;&nbsp;【 <a   href= "add.asp?shibie= "& <%   =shibie   %>   class= "xiah "> 添加内容 </a> 】




<%   end   if

dim   conn
dim   connstr
dim   db
db= "/Datebases/quest.mdb "  
on   error   resume   next
connstr= "DBQ= "+server.mappath(db)+ ";DefaultDir=;DRIVER={Microsoft   Access   Driver   (*.mdb)}; "
set   conn=server.createobject( "ADODB.CONNECTION ")
if   err   then
err.clear
else
conn.open   connstr
end   if


  %>     </td>
                </tr>
                <tr   align= "center "   bgcolor= "#CAD0F7 ">
                    <td   width= "62% "   height= "30 "   bgcolor= "#CAD0F7 "> 标题 </td>
                    <td   width= "14% "> 添加/修改时间 </td>
                    <td   width= "15% "> 所属版块转移 </td>
                    <td   width= "9% "> 相关操作 </td>
                </tr>
                <%

shibie   =   Trim(Request.QueryString( "shibie "))

if   isNumeric(shibie)=false   or   shibie= " "   then
      shibie   =   0              
end   if

if   len(shibie) <> " "   then
                                                   
Set   rs   =   Server.CreateObject( "ADODB.RecordSet ")
sql= "select   *   from   [content]   where   shibie= "&shibie& "   order   by   id   asc "

else

Set   rs   =   Server.CreateObject( "ADODB.RecordSet ")
sql= "select   *   from   [content]   order   by   id   asc "

end   if

rs.open   sql,conn,1,2

If   rs.Eof   Then
response.Write   " <tr> <td   height= '30 '   bgcolor= '#FFFFFF '   colspan= '5