asp 方面的,高手指点!~!~急

来源:百度知道 编辑:UC知道 时间:2024/06/18 11:15:36
我想要的功能是:单击"评定"后会自动给当前操作的这条记录zt字段赋值,0或1都可以,怎么实现呢?帮我啊!!
<!--#include file="db.inc.asp"-->
<body>
<%
exec="select * from db_xcpkf1"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<table width="80%" border="1" align="center" cellpadding="0" cellspacing="0">
<%do while not rs.eof%>
<tr>
<td width="15%"><span class="STYLE2">编号: <%=rs("bh")%></span></td><%q=rs("bh")%>
<td width="20%"><span class="STYLE2">产品名称: <%=rs("xcpmc")%></span></td>
<td width="14%"><span class="STYLE2">开始日期: <%=rs("ksrq")%></span></td>
<td width="14%"><span class="STYLE2&qu

set rst1=conn.execute("insert into db_xcpkf1 where bh='"&q&"' (zt) values ('0')")

你这个语句错的,insert是插入一条新的值,没有条件可言所以where不要,
insert into 表名(字段1,字段2,..)values(值1,值2,..)
我不知道你想要实现什么功能,我是这样理解的,
zt是0就让他变为1,是1就让它变为0,像发表的文章置顶一样,
数据库默认为0那么
if rs("zt")=0 then
Conn.execute "Update db_xcpkf1 Set zt=1 where bh='"&q&"'"
else
Conn.execute "Update db_xcpkf1 Set zt=0 where bh='"&q&"'"
end if