ODBC 驱动程序不支持所需的属性(有代码)
输入日期,然后按日期查询:
代码:
<html>
<head>
<title>按出版年月查询</title>
</head>
<body >
<%
dim chubannianyue
dim var '传给allinfo.asp的参数
dim pages '查询的记录共有多少条记录?
dim maxcounts '每页需要放多少条记录
dim currentpage '当前页数
dim recordcounts '总记录数
maxcounts=30
if isempty(Request.QueryString("chubannianyuenext")) then
chubannianyue=trim(Request.Form("chubannianyue"))
else
chubannianyue=Request.QueryString("chubannianyuenext")
end if
chubannianyue=datevalue(chubannianyue)
dim chubannianyuenext '给下一次调用该页的时候传递chubannianyue的值
'chubannianyue=Request.Form("chubannianyue")
if not isempty(Request.QueryString("currentpage")) then
currentpage=cint(Request.QueryString("currentpage"))
else
currentpage=1
end if
set rs1=Server.CreateObject("ADODB.RecordSet")
str1="select * from tsk where 出版年月= '%"&chubannianyue&"%'"
rs1.open str1 ,"DSN=library",3,3//**********************出错行
if not rs1.EOF then
recordcounts=rs1.recordcount
pages=cint(recordcounts/maxcounts +1)
%>
<table width=760 border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#CCFFFF" height="24" width=760>
<div align="left"><font color="#000099">共有<%=recordcounts%>条记录,当前是第<%=currentpage%>页 我要到第
<%
dim j
j=1
while j<=pages
Response.Write ("|")
%>
<a href=chubannianyuesearch.asp?currentpage=<%=server.urlencode(Response.Write(j))%>&chubannianyuenext=<%=server.urlencode(chubannianyue)%>>
<%=Response.Write(j)%>
</a>
<%
j=j+1
wend
%>
页去</font></div>
</td>
</tr>
</table>
<p>
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="160">分类号</td>
<td width="600">正题名</td>
</tr>
<%
dim i
i=0
if currentpage>1 then
if (currentpage-1)*maxcounts<recordcounts then
rs1.Move (currentpage-1)*maxcounts
Response.Write (rs1.eof)
end if
end if
while not rs1.EOF and i<maxcounts and not rs1.BOF
i=i+1
%>
<tr>
<td width="160"><%Response.Write (rs1(0))%></td>
<td width="600">
<!--<form name="form1" method="post" action="allinfo.asp">
<input type="text" name="textfield" size="50" value=<%=rs1(4)%>>
<input type="submit" name="Submit" value="查看详细资料">
</form>
<%=rs1(1)%> <%=rs1(2)%> <%=rs1(3)%> <%=rs1(4)%> <%=rs1(5)%> <%=rs1(6)%> <%=rs1(7)%> <%=rs1(8)%>>
-->
<% var=rs1(4)%>
<% server.urlencode(var)%>
<a href=allinfo.asp?var=<%=server.urlencode(rs1(4))%>><%=rs1(4)%></a>
</td>
</tr>
<%
rs1.MoveNext
Wend
else
Response.Write("没有找到满足条件的记录!")
end if
rs1.close
%>
</table>
</body>
</html>