我是新手,大家来帮帮我把
<% @language=VBscript %>
<%
Option Explicit
Response.expires=0
%>
<!--METAATDATA nAME="Microsoft ActiveX Data Objects 2.6 Library"
TYPE ="TypeLib" UUID ="{000000205-0000-0010-8000-00AA006D2EA4}"-->
<Html><head><title>my example</title></head>
<body>
<%
const intPageSize =10
Dim intCur,intTotal,I
dim cn,rst,strConn,strSql
if Request.serverVariables("CONtENT-LENGTH")=0 then
intCur=1
else
intCur=Cint(Request.form("CurPage"))
select Case Request.form("Page")
case "首页"
intCUr=1
case "上一页"
intCur=IntCUr+1
case "下一页"
intCur=intCur-1
case "尾页"
intCur=Cint(Request.form("LastPage"))
end select
end if
strConn="Provider=Sqloledb.1;Persist Security Info=False;User ID=sa; Password=;Initial Catalog=hrrs; Data Source=hr4096"
set cn=Server.createObject("adodb.connection")
cn.open strconn
set rst=server.createobject("adodb.Recordset")
rst.cursorLocation=adUseClient
rst.cursortype=adopenstatic
rst.cahesize=intpagesize
strsql="select * from yghmc where bm is not null "
rst.open strsql,strconn,,,adcmdtext
rst.pagesize=intpagesize
if not rst.eof then
rst.absolutepage=intcur
end if
intTotal=rst.pagecount
%>
<p>
<B>共有人员:<%=Rst.recordcount %> 共<%=inttotal%>页 当前是<%=intcur %>页</b><p>
<form action="<%=request.servervariables("script_name")%>"Method="post">
<input type="hidden" name="curpage" value="<%=intCur%>">
<input type="hidden"name="LagePage"value="<%=inttotal%>">
<input type ="submit" Name="page"value="首页"> <%if intcur>1 then %>
<input type ="submit" name="page"value="上一页"> <%end if%>
<%if intCur=intTotal then %>
<input type="subMit" name="page" value="下一页"> <%end if %>
<%if intcur<>inttotal then %>
<input type="submit" name="page" value="尾页">
</form>
<%
I=0
response.write"<Table border cellspacing=1 cellpadding=7>"
do while not rst.eof and i< rst.pagesize
respose.write"<tr height=12><td width=20>" & rst.absoluteposition & "</td> " &_
"<td width =160>" & rst("bh") & " </td>" &_
"<td width=180>" & rst("xm") & "</td>" &_
"<td width=40>" & rst("xb") & "</td>(/tr>"
rst.movenext
I=I+1
loop
response.write"</table>"
rst.close
%>
</body></html>
********************************************
我将它copy到我的C:\inetpub\scripts下面,
可是不能打开数据库
我是新手