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

ASP使用查询数据库语句时遇到参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style>
*
{
padding:0;
margin:0;}
.css{
font-size:14px;
color:#FF0000;}
</style></head>

<body>
<!-- #include file="top.asp"-->
<table width="1002" border="1" cellspacing="0" cellpadding="0">
  <tr>
  <td align="left" width="20%"><!-- #include file="left.asp"--></td>
<td align="center" valign="top"><table width="98%" border="1" cellspacing="0" cellpadding="0">
  <tr>
  <td width="15" height="30" >&nbsp;</td>
  <td align="left" class="css">图书馆新闻</td>
  </tr>
  <tr>
  <td></td>
  <td> 

  <table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
  <td height="18" align="left" valign="middle" bgcolor="#CCCCCC"><img src="image/title/2008228103419_61_mb5u_com1.gif" alt="知识产权新闻" /> <strong><font color="#CC0000">业界新闻</font></strong></td>
  </tr>
  </table>
  <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr>
  <td width="67%">
  <table>
  <tr>
  <td height='3'></td>
  </tr>
  </table>
  <%
set rt=server.CreateObject("adodb.recordset")
rt.open "select top 5 * from news order by id desc",conn,1,1
  %>
  <%
if rt.eof and rt.bof then
response.Write("暂时没有新闻信息!")
else
do while not rt.eof
%>
  <table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
  <td width="16" align="center"><img src="image/title/200822810180_111_mb5u_com.gif" width="16" height="16" alt="知识产权新闻" /></td>
  <td align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <td><a href="xx_news.asp?id=<%=rs("id")%>" target="_blank"><%=Mid(rt("title"),1,32)%></a></td>
  </tr>
  </table></td>
  <td width="50" align="right">
<font color="#CC0000"><%=rt("hit")%></font>