在本地机运行正常,传上服务器不行,我的代码有错吗?(附代码)

32572 2001-08-03 10:49:03
<%
set dataconn=server.CreateObject("adodb.connection")
session("connstring")="Driver={Microsoft Access Driver (*.MDB)};DBQ="&Server.MapPath("maillist.mdb")
cn=session("connstring")
dataconn.connectionstring=cn
dataconn.open

if request("method")="del" then
dataconn.execute("delete from maillist where ID="&request("iD"))
end if

sql1="select * from maillist order by id"
set rs_main=Server.CreateObject("Adodb.Recordset")
rs_main.open sql1,dataconn,1,2


sql2="select * from maillist order by id"
set rs2=Server.CreateObject("Adodb.Recordset")
rs2.open sql2,dataconn,1,2
rs2.movefirst
a=0
do while not rs2.eof
a=a+1
rs2.movenext
loop

sql3="select * from maillist where gai=0 order by id"
set rs3=Server.CreateObject("Adodb.Recordset")
rs3.open sql3,dataconn,1,2
rs3.movefirst
b=0
do while not rs3.eof
b=b+1
rs3.movenext
loop

sql4="select * from maillist where gai=1 order by id"
set rs4=Server.CreateObject("Adodb.Recordset")
rs4.open sql4,dataconn,1,2
rs4.movefirst
c=0
do while not rs4.eof
c=c+1
rs4.movenext
loop

%>

<%
if not rs_main.eof then
rs_main.pagesize=35

if request.querystring("page")="" then
spage=1
rs_main.absolutepage=spage
else
spage=int(trim(request.querystring("page")))
rs_main.absolutepage=spage
end if

if request.form("page")<>"" then
spage=int(trim(request.form("page")))
rs_main.absolutepage=spage
end if%>
<% end if %>

<html>
<head>
<title></title>

<script language="JavaScript">
<!--

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_nbGroup(event, grpName) { //v3.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
if ((nbArr = document[grpName]) != null)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
}
//-->
</script>
<style type="text/css">
<!--
a:hover {font-size:10pt;color:#ff3333;text-decoration:none}
table { font-family: "宋体"; font-size: 12px; color: #000000}
-->
</style>
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
</head>

<body bgcolor="#999999">
<div id="Layer2" style="position:absolute; width:772px; height:115px; z-index:2; top: 14px; left: 4px">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> --------------------------------------邮件管理----------------------------<a href="email.asp">邮件发送</a>----------------------------------------------
<hr>
</td>
</tr>
<tr>
<td align="center" height="2">
<table width="94%" border="0" cellspacing="0" cellpadding="0">
<form action="adminindex.asp?spage=<%=spage-1%>" method="post">

<tr>
<td width="30%"><font color="#000000" size="2"><%=spage%> / <%=rs_main.pagecount%>  直接到第
<input name="page" size=3 value="<%=spage%>">
页 </font></td>
<td width="50%"><font color="#000000">共有记录
<%response.write "<b>"&a&"</b>"%>
条----其有
<%response.write "<b>"&b&"</b>"%>
人定阅----有
<%response.write "<b>"&c&"</b>"%>
人已退定 </font></td>
<td width="20%">
<div align="right"><font color="#000000" size="2">
<%
if spage>1 then
response.write"<p align=right><a href=adminindex.asp?page="&(spage-1)&">上一页</a>"
else response.write "  上一页"
end if
if spage<rs_main.pagecount then
response.write"  <a href=adminindex.asp?page="&(spage+1)&">下一页</a>   "
else response.write "  下一页   "
end if
%>
</font></div>
</td>
</tr>
</form>

</table>

</td>
</tr>
<tr>
<td align="center">
<table width="99%" border="1" cellspacing="0">
<tr bgcolor="#669999">
<td width="23%">EMAIL</td>
<td width="17%">加入日期</td>
<td width="6%">状态</td>
<td width="5%">操作</td>
<td width="22%">EMAIL</td>
<td width="16%">加入日期</td>
<td width="6%">状态</td>
<td width="5%">操作</td>
</tr>
<form action="admin.asp" method="get">


<%
ipage=1
do while ipage<=rs_main.pagesize

if not rs_main.EOF then
%>
<tr>
<td width="23%"><font color="#000000" size="2"><%=rs_main("email")%>
</font></td>
<td width="17%"><font color="#000000" size="2"><%=rs_main("dateandtime")%></font></td>
<td width="6%"><font color="#000000" size="2">
<% if rs_main("gai")=0 then response.write("定阅") else response.write("已退定") end if %>
</font></td>
<td width="5%"><font color="#000000"><a href="adminindex.asp?method=del&id=<%=rs_main("id")%>&page=<%=spage%>">删除</a></font></td>
<%
rs_main.movenext
ipage=ipage+1
end if
if not rs_main.eof then
%>

<td width="22%"><font color="#000000" size="2"><%=rs_main("email")%></font></td> <td width="16%"><font color="#000000" size="2"><%=rs_main("dateandtime")%></font></td>
<td width="6%"><font color="#000000" size="2">
<% if rs_main("gai")=0 then response.write("定阅") else response.write("已退定") end if %>
</font></td>
<td width="5%"><font color="#000000"><a href="adminindex.asp?method=del&id=<%=rs_main("id")%>&page=<%=spage%>">删除</a></font></td>
</tr>
<%
rs_main.movenext


end if

ipage=ipage+1

loop


%>
</form>
<tr>
<td width="23%"> </td>
<td width="17%"> </td>
<td width="6%"> </td>
<td width="5%"> </td>
<td width="22%"> </td>
<td width="16%"> </td>
<td width="6%"> </td>
<td width="5%"> </td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>
...全文
95 点赞 收藏 8
写回复
8 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
32572 2001-08-06
算了
加不了给自已,加给各位算了。
回复
32572 2001-08-06
好啊
回复
sunxiaoli 2001-08-06
给自己加几分吧!
回复
32572 2001-08-04

我自已把问题解决了。
rs.open sql,dataconn,1,2
rs.movefirst
这里写少了一句。
rs.open sql,dataconn,1,2
if not rs.eof then
rs.movefirst
end if
ok

至于为什么在本地机可以,这个我也想不明。
回复
32572 2001-08-03
要不我把文件给你
回复
asp3 2001-08-03
你这样叫人怎么看啊,错误怎么会没提示??
回复
32572 2001-08-03
没有提示,就是运行不了,但在本地机(win98+pws)运行正常,但同一网站中的其他文件运行也正常。
回复
hitwd2000 2001-08-03
提示什么错误信息??
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2001-08-03 10:49
社区公告
暂无公告