asp中参数传递的问题

沙枣花开-沁人的香 2009-07-01 08:33:29
我要实现新闻的修改,方法如下:
列表页1.asp获取参数值articleid
到达修改页面2.asp,参数能够实现传递,在该页中articleid不能改变的
点击提交到达3.asp页面,写入数据库,但是在这里不能获取articleid参数,显示总是0,为什么?
部分代码如下:
2.asp
<%
dim rs
dim strsql
articleid=Cint(request("articleid"))
If articleid>0 Then
strsql="select * from article where articleid= "
strsql=strsql & cstr(articleid)
set rs=Server.CreateObject("ADODB.Recordset")
Set Rs=conn.Execute (strsql)'("Select * From article where articleid=" & cstr(articleid))
%>
3.asp
<%
dim rs
dim sql
articleid=Cint(request("articleid")) '这获取的编号为0response.Write(articleid)
set rs=server.createobject("adodb.recordset")
If articleid>0 Then
sql="select * from article where articleid="
sql=sql & cstr(articleid)
rs.open sql,conn,1,3
rs("title")=trim(request.form("title"))
rs("content")=trim(request.form("content"))
rs("nclassid")=trim(request.form("nclassid"))
rs("user")=trim(request.form("user"))
rs.update
rs.close
conn.close
set rs=nothing
set conn=nothing
response.redirect("articlelist.asp")
end if
%>
...全文
37 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
问题已经解决了,自己的粗心呀,上面的代码没问题

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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