我的分页显示asp代码连接数据库的时候有问题,一直报错500, 80
<%@LANGUAGE="VBSCRIPT"%><%session("user_ID")="10000"%><html><head></head><body><%setd...
<%@LANGUAGE="VBSCRIPT"%>
<%
session("user_ID")="10000"
%>
<html>
<head>
</head>
<body>
<%
set db= server.createobject("ADODB.connection")
db.open"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("edu_manage.mdb")
dim rs,sql,user_ID
user_ID= session("user_ID")
set rs=server.createobject("ADODB.recordset")
sql="select * from where techer_ID= user_ID"
rs.open sql,db,1 '参数设置为键盘指针
'分页显示
if not rs.bof and not rs.eof then
dim intPage
if request.querystring("varPage")="" then
intPage=1
else
intPage=cint(request.querystring("varPage"))
end if
'每页显示数量
rs.pagesize=8
rs.absolutepage=intPage
'在表格中显示记录
response.write "<table border="1" width="100%">"
response.write "<th>课程号</th><th>课序号</th><th>课程名</th><th>学分</th><th>开设学院 </th><th>学期学年</th><th>校区</th><th>删除</th><th>修改</th>"
dim i
for i=1 to rs.pagesize
response.write "<tr>"
response.write "<td>" $rs("course_ID") &"</td>"
response.write "<td>" $rs("course_num") &"</td>"
response.write "<td>" $rs("") &"</td>"
response.write "<td>" $rs("course_cre") &"</td>"
response.write "<td>" $rs("school") &"</td>"
response.write "<td>" $rs("acadYear_term") &"</td>"
response.write "<td>" $rs("campus") &"</td>"
response.write "</tr>
rs.movenext
next
response.write "</table>"
response.write "<p><a href='course.asp?varpage=1'>第1页</a> "
if intPage>1 then
response.write "<p><a href='"course.asp?varpage="&(intPage-1)&"'>上一页</a> "
else
response.write "上一页 "
end if
if intPage<rs.pagecount then
response.write "<p><a href='"course.asp?varpage="&(intPage+1)&"'>下一页</a> "
else
response.write "下一页 "
end if
response.write "<p><a href='"course.asp?varpage="&rs.pagecount&"'>下一页</a> "
else
response.write "课程记录为空"
end if
%>
</body>
</html>
下面是数据库:
courseinfoIDcourse_IDcourse_numcourse_creschoolacadYear_termcampusteacherteacher_ID110000java3计算机2012-2013学年秋(上学期)望江校区袁莉10000210001java3计算机2012-2013学年秋(上学期)望江校区袁莉10000310002java3计算机2012-2013学年秋(上学期)望江校区袁莉10000410003java3计算机2012-2013学年秋(上学期)望江校区袁莉10000510004java3计算机2012-2013学年秋(上学期)望江校区袁莉10000 展开
<%
session("user_ID")="10000"
%>
<html>
<head>
</head>
<body>
<%
set db= server.createobject("ADODB.connection")
db.open"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("edu_manage.mdb")
dim rs,sql,user_ID
user_ID= session("user_ID")
set rs=server.createobject("ADODB.recordset")
sql="select * from where techer_ID= user_ID"
rs.open sql,db,1 '参数设置为键盘指针
'分页显示
if not rs.bof and not rs.eof then
dim intPage
if request.querystring("varPage")="" then
intPage=1
else
intPage=cint(request.querystring("varPage"))
end if
'每页显示数量
rs.pagesize=8
rs.absolutepage=intPage
'在表格中显示记录
response.write "<table border="1" width="100%">"
response.write "<th>课程号</th><th>课序号</th><th>课程名</th><th>学分</th><th>开设学院 </th><th>学期学年</th><th>校区</th><th>删除</th><th>修改</th>"
dim i
for i=1 to rs.pagesize
response.write "<tr>"
response.write "<td>" $rs("course_ID") &"</td>"
response.write "<td>" $rs("course_num") &"</td>"
response.write "<td>" $rs("") &"</td>"
response.write "<td>" $rs("course_cre") &"</td>"
response.write "<td>" $rs("school") &"</td>"
response.write "<td>" $rs("acadYear_term") &"</td>"
response.write "<td>" $rs("campus") &"</td>"
response.write "</tr>
rs.movenext
next
response.write "</table>"
response.write "<p><a href='course.asp?varpage=1'>第1页</a> "
if intPage>1 then
response.write "<p><a href='"course.asp?varpage="&(intPage-1)&"'>上一页</a> "
else
response.write "上一页 "
end if
if intPage<rs.pagecount then
response.write "<p><a href='"course.asp?varpage="&(intPage+1)&"'>下一页</a> "
else
response.write "下一页 "
end if
response.write "<p><a href='"course.asp?varpage="&rs.pagecount&"'>下一页</a> "
else
response.write "课程记录为空"
end if
%>
</body>
</html>
下面是数据库:
courseinfoIDcourse_IDcourse_numcourse_creschoolacadYear_termcampusteacherteacher_ID110000java3计算机2012-2013学年秋(上学期)望江校区袁莉10000210001java3计算机2012-2013学年秋(上学期)望江校区袁莉10000310002java3计算机2012-2013学年秋(上学期)望江校区袁莉10000410003java3计算机2012-2013学年秋(上学期)望江校区袁莉10000510004java3计算机2012-2013学年秋(上学期)望江校区袁莉10000 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询