ODBC 驱动程序不支持所需的属性(有代码)

godbirdhu 2002-05-20 10:58:59
输入日期,然后按日期查询:
代码:
<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>
...全文
71 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
godbirdhu 2002-05-20
  • 打赏
  • 举报
回复
按其他查询都是对的,就是这个不对,怎么高的呢

21,890

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧