I是初学者,各位WEB开发高手,帮帮我吧!!做在线调查!出现如下问题??

tjkb12 2003-10-13 05:50:26
我在做在线调查时,点提交后,没有出现错误提示!!
 可是我去查数据库发现点重被调查的数据并没有+1,代码如下,请各位,才我看看!!
 谢了,我是初学才,
随便在问问有什么比较好的WEB开发工具!!少写程序的

<!--#include file="conn.asp"-->
<%
lr=request("lr")

'检查是否核取候选人
if isempty(lr) then
response.write"你没有选择候选人,回上一项重新选取"
response.write"<a href='vbscript:history.back'>回上一页</a></p>"
response.end
end if

lr=split(lr,",")
for i=0 to ubound(lr)
set rs1=server.createobject("adodb.recordset")
strsql="selete * from vote where lr='''&trim(name(i))&'''"
rs1.open strsql,conn,3,3
rs1("grade")=rs("grade")+1
rs1.update
rs1.colse
set rs1=nothing
conn.close
set conn=nothing
next
response.redirect"result.asp"
%>
...全文
36 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
tjkb12 2003-10-14
  • 打赏
  • 举报
回复
没有解决,望各位在帮帮忙吧???
不老书生 2003-10-14
  • 打赏
  • 举报
回复
set conn=nothing放在next的外面

next
set conn=nothing
不老书生 2003-10-14
  • 打赏
  • 举报
回复
strsql="selete * from vote where lr='''&trim(name(i))&'''"

---》》》

strsql="selete * from vote where lr='"&trim(name(i))&"'"
wzgan 2003-10-14
  • 打赏
  • 举报
回复
2.asp
'-==================================

<!--#include file="conn.asp"-->
<%
lr=request("lr")

'检查是否核取候选人
if isempty(lr) then
response.write"你没有选择候选人,回上一项重新选取"
response.write"<a href='vbscript:history.back'>回上一页</a></p>"
response.end
end if

'lr=split(lr,",")
'for i=0 to ubound(lr)
set rs1=server.createobject("adodb.recordset")
sql="select * from vote"

rs1.open sql,conn,3,3
do while not rs1.eof
if rs1("lr") = lr then
rs1("grade")=rs1("grade")+1
rs1.update
end if
rs1.movenext
loop
rs1.close

conn.close
set conn=nothing
'next
response.redirect"result.asp"
%>


'测试过了可以!
wzgan 2003-10-14
  • 打赏
  • 举报
回复
有空就帮你改了一下,呵呵!!

1.asp

<!--#include file="conn.asp"-->
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<STYLE type=text/css>TD {
FONT-SIZE: 12px
}
</STYLE>

<body bgcolor="#FFFFFF" text="#000000">
<div align="center">
<p>康新医疗在线调查</p>
<form name="form1" method="post" action="2.asp">
<table width="32%" border="0" height="112" cellspacing="4" bgcolor="#CCCCCC">
<%set rs=server.createobject("adodb.recordset")
sql="select * from vote"
rs.open sql,conn,2,3
do while not rs.eof%><tr>
<td width="17%">
<div align="center"><%=rs("id")%></div>
</td>

<td width="83%">

<input type="radio" name="lr" value="<%=rs("lr")%>">
<%=rs("lr")%>

</td>

<%
rs.movenext
loop
%>
</tr>

<tr>
<td width="17%" height="2"> </td>
<td width="83%" height="2">    

<input type="submit" name="Submit" value="提 交">
 
<input type="RESET" name="Submit2" value="取 消">
</td>
</tr>
</table>
</form>
<p> </p>
</div>
</body>
</html>

tjkb12 2003-10-13
  • 打赏
  • 举报
回复
上面的老兄,还是不能解决这个问题??
看还什么有毛病没有

提交表单的在下
<!--#include file="conn.asp"-->
<%
dim rs
dim sql
set rs=server.createobject("adodb.recordset")
sql="select * from vote"
rs.open sql,conn,1,1
%>

<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<STYLE type=text/css>TD {
FONT-SIZE: 12px
}
</STYLE>

<body bgcolor="#FFFFFF" text="#000000">
<div align="center">
<p>康新医疗在线调查</p>
<form name="form1" method="post" action="vote.asp">
<table width="32%" border="0" height="112" cellspacing="4" bgcolor="#CCCCCC">
<tr>
<td width="17%">
<div align="center">1.</div>
</td>
<td width="83%">

<input type="radio" name="lr" value="<%=rs("lr")%>">
<%=rs("lr")%>
</td>
</tr>
<%rs.movenext%>
<tr>
<td width="17%" height="2">
<div align="center">2.</div>
</td>
<td width="83%" height="2">

<input type="radio" name="lr" value="<%=rs("lr")%>">
<%=rs("lr")%>
</td>
</tr>
<%rs.movenext%>
<tr>
<td width="17%">
<div align="center">3.</div>
</td>

<td width="83%">

<input type="radio" name="lr" value="<%=rs("lr")%>">
<%=rs("lr")%> </td>
</tr>
<tr>
<td width="17%">
<div align="center">4.</div>
</td>
<%rs.movenext%>
<td width="83%">

<input type="radio" name="lr" value="<%=rs("lr")%>">
<%=rs("lr")%>
</td>
</tr>
<tr>
<td width="17%" height="2"> </td>
<td width="83%" height="2">    

<input type="submit" name="Submit" value="提 交">
 
<input type="RESET" name="Submit2" value="取 消">
</td>
</tr>
</table>
</form>
<p> </p>
</div>
</body>
</html>
wzgan 2003-10-13
  • 打赏
  • 举报
回复
rs1("grade")=rs("grade")+1

改为
rs1("grade")=rs1("grade")+1

就OK了
========================
随便在问问有什么比较好的WEB开发工具!!少写程序的
========================================
用Macromedia Dreamweaver MX
或者用
EDITPLUS

Dreamweaver 初学者就比较好上手的!!
avonqin 2003-10-13
  • 打赏
  • 举报
回复
能看你的提交表单的代码吗?

28,406

社区成员

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

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