<!--#include file="opendb.asp"-->
<%
on error resume next
set rst=server.createobject("adodb.recordset")
id=request.querystring("id")
if request.querystring("act")="modify" then
conn.begintrans
rst.open "select * from user where u_id="&id, conn, 1, 3
rst("u_user")=request.form("f_user")
rst("u_code")=request.form("f_code")
rst.update
rst.close
rst.open "select * from info where i_uid="&id, conn, 1, 3
rst("i_name")=request.form("f_name")
rst("i_sex")=request.form("f_sex")
rst("i_age")=request.form("f_age")
if request.form("f_vip")=1 then
rst("i_vip")=true
else
rst("i_vip")=false
end if
rst.update
rst.close
if err.number>0 then
response.write("更新失败")
conn.rollbacktrans
else
response.write("更新成功")
conn.committrans
end if
end if
%>
<table width="779" height="744" border="0" cellspacing="1" background="img/hyzlxg.jpg">
<tr>
<td width="52" height="126"> </td>
<td width="682"> </td>
<td width="35"> </td>
</tr>
<tr>
<td height="550"> </td>
<td align="center" valign="middle">
<%rst.open "select * from user,info where u_id="&id&" and i_uid="&id, conn, 1, 1%>
<form name="fomr1" method="post" action="modify.asp?act=modify&id=<%=request.querystring("id")%>">
<table width="574" height="318" border="0" cellpadding="5" cellspacing="1">
<tr>
<td colspan="2" align="center">请在下面表中填写你的资料</td>
</tr>
<tr>
<td width="117" align="right">用户名:</td>
<td width="434" align="left"><input type="text" name="f_user" id="f_user" value="<%=rst("u_user")%>" /></td>
</tr>
<tr>
<td align="right">密 码: </td>
<td align="left"><input type="password" name="f_code" id="f_code" value="<%=rst("u_code")%>" /></td>
</tr>
<tr>
<td align="right">姓 名:</td>
<td align="left"><input type="text" name="f_name" id="f_name" value="<%=rst("i_name")%>" /></td>
</tr>
<tr>
<td align="right">年 龄:</td>
<td align="left"><input type="text" name="f_age" id="f_age" value="<%=rst("i_age")%>" /></td>
</tr>
<tr>
<td height="37" align="right">性 别:</td>
<td align="left"><input type="text" name="f_set" value="<%=rst("i_sex")%>" /></td>
</tr>
<tr>
<td align="right">VIP:</td>
<td align="left"> <input type="radio" name="f_vip" value="1" <% if rst("i_vip") then
response.write "checked" end if%> />是
<input type="radio" name="f_vip" value="0" <% if not rst("i_vip") then
response.write "checked" end if%>/>否
</td>
</tr>
<tr>
<td colspan="2" align="center" valign="middle"><input type="submit" name="sub" value="修改"> <input type="reset" name="res" value="重置"/></td>
</tr>
</table></form> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<%rst.close
set rst=nothing
conn.close
set rst=nothing
%>
错误类型:
Microsoft VBScript 编译器错误 (0x800A0412)
必须是行中的第一个语句
/zy/modify.asp, line 81, column 25
response.write "checked" end if
到底错哪了,找了半天找不出来。81行就是加红字那一行。