51代码网ORACLEMYSQLSQL SERVER其它数据库java/jspasp/asp.netC/C++/VC++APP应用其它语言服务器应用
您现在的位置: 51代码网 >> asp.net >> 文章正文

call CloseConn() 出错

更新时间:2012-3-26:  来源:51代码网

<body>
<table cellpadding="2" cellspacing="1" border="0" width="100%" align="center" class="a2">
<tr><td class="a1" height="25" width="100%" align="center" class="font_cl">报名登记管理</td></tr>
<tr class="a4"><td class="font_cl">
<%
if Request.QueryString("type")="del" then
BM_id=trim(request.QueryString("BM_id"))
if BM_id<>"" then
sql="delete from BM_User where BM_id=" & Clng(BM_id)
conn.Execute sql
end if
call CloseConn() response.redirect "index.asp"


end if

const MaxPerPage = 20
dim currentPage,totalPage,totalPut,pagecount
sql="select * from BM_User order by BM_Date desc"
set NewsListRs = Server.Createobject("adodb.recordset")
NewsListRs.open sql,conn,1,1
   
if NewsListRs.EOF then
Response.Write("<p align=center>无报名信息!</p>")
  else
currentPage = ReplaceStr(Request("page"))
if currentPage <> "" then
if not IsNumeric(currentPage) then
currentPage = 1
else
currentPage = CInt(currentPage)
end if
else
currentPage = 1
end if
if currentPage < 1 then currentPage = 1
totalPut = NewsListRs.RecordCount
totalPage = Int((totalPut/MaxPerPage) * -1) * -1
if currentPage > totalPage then
currentPage = totalPage
end if

if currentPage > 1 then
NewsListRs.Move (currentPage - 1) * MaxPerPage
end if
Response.Write("<table width='100%' align='center' style='word-break:break-all' cellspacing='2' cellpadding='5' class='a2'>")
Response.Write("<tr align='center' bgcolor='#C0C0C0' class='title'><td width='5%'>序号</td><td width='10%'>姓名</td><td width='10%'>性别</td><td width='20%'>身份证号码</td><td width='30%'>家庭住址</td><td width='10%'>报名时间</td><td width='15%'>操作</td></tr>")
pagecount=0
do while not NewsListRs.eof and pagecount<MaxPerPage
InfoStr="<tr align='center' class='tdbg' bgcolor='#E3E3E3'><td>"&pagecount+1&"</td><td align='left' style='padding-left:10px;'><a href=BM_info.asp?BM_id="&NewsListRs("BM_id")&" target=_blank>"&GetTopic(NewsListRs("BM_Name"),30)&"</a></td><td>"&NewsListRs("BM_Sex")&"</td><td>"&NewsListRs("BM_IDCard")&"</td><td>"&NewsListRs("BM_Address")&"</td><td>"&NewsListRs("BM_Date")&"</td>"
if NewsListRs("BM_id")=3 then
InfoStr=InfoStr&"<td><a href='#' title='测试数据,不允许删除!'>删除(测试数据,已禁止删除!)</a></td></tr>"
else
InfoStr=InfoStr&"<td><a href='index.asp?BM_id="&NewsListRs("BM_id")&"&type=del' onClick='return ConfirmDel();'>删除</a></td></tr>"
end if
Response.Write(InfoStr)
NewsListRs.movenext
pagecount=pagecount+1
loop
Response.Write("</table><br>")
end if
if totalPut > MaxPerPage then
  showpage2 currentPage, totalPage, MaxPerPage, totalPut, null
end if
%>
</td></tr>
</table>
<%
sub DelArticle(BM_id)
conn.execute("delete from BM_User where BM_id="&BM_id&"")
end sub
%>
</body>
</html>
定义CloseConn()函数的文件include进来了吗?前面并没有打开连接的操作,为什么要关闭连接呢
call CloseConn()  

  • 上一篇文章:
  • 下一篇文章: 没有了
  • 赞助商链接
    推荐文章
  • 此栏目下没有推荐文章
  • {
    设为首页 | 加入收藏 | 友情链接 | 网站地图 | 联系站长 |