谁来帮帮 找出错误
<%dim id
id=session("sfid")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("games.mdb")
s_name=request.form("name")
s_ip=request.form("ip")
s_date=request.form("date")
s_oicq=request.form("oicq")
s_type=request.form("type")
s_line=request.form("line")
s_web=request.form("web")
s_pic=request.form("pic")
s_area=request.form("area")
dim sql,sqlr,sqll
on error resume next
if trim(s_name)="" or trim(s_ip)="" then
response.write "请输入名字与IP地址"
response.write "<a href='insert_form.asp'>重新输入</a>"
else
conn.begintrans '开始事物处理
dim strsql
strsql="delete from sf where sfid="&id
conn.execute(strsql)
sqlr="insert into sf(sfname,sfip"
sqll="values('"&s_name&"','"&s_ip&"'"
if s_date<>"" then
sqlr=sqlr & ",sfdate"
sqll=sqll & ",'"&s_date&"'"
end if
if s_oicq<>"" then
sqlr=sqlr & ",sfoicq"
sqll=sqll & ",'"&s_oicq&"'"
end if
if s_type<>"" then
sqlr=sqlr & ",sftype"
sqll=sqll & ",'"&s_type&"'"
end if
if s_line<>"" then
sqlr=sqlr & ",sfline"
sqll=sqll & ",'"&s_line&"'"
end if
if s_web<>"" then
sqlr=sqlr & ",sfweb"
sqll=sqll & ",'"&s_web&"'"
end if
if s_pic<>"" then
sqlr=sqlr & ",sfpic"
sqll=sqll & ",'"&s_pic&"'"
end if
if s_area<>"" then
sqlr=sqlr & ",sfarea"
sqll=sqll & ",'"&s_area&"'"
end if
end if
sql=sqlr & ")" & sqll & ")"
conn.execute(sql)
if conn.errors.count=0 then
'提交事物处理
response.write "<center>"&"<table width='80%' border='1' bordercolor='#FFFF33' cellpadding='0' cellspacing='0'>"
response.write "<tr>"&"<td bgcolor='#FFCC00'>"&"修改成功"&"</td>"&"<td bgcolor='#E2E745'>"&"如下是你发布的信息:"&"</td>"&"</tr>"
response.write "<tr>"&"<td width='12%' bgcolor='#FFCC00'>"&"<p>私服名字"&"</td>"&"<td bgcolor='#E2E745'>" & s_name &"</td>"&"</tr>"
response.write "<tr>"&"<td bgcolor='#FFCC00'>"&"<p>私服ip" &"</td>"&"<td bgcolor='#E2E745'>" &s_ip &"</td>"&"</tr>"
response.write "<tr>"&"<td bgcolor='#FFCC00'>"&"<p>开放时间" &"</td>"&"<td bgcolor='#E2E745'>"& s_date &"</td>"&"</tr>"
response.write "<tr>"&"<td bgcolor='#FFCC00'>"&"<p>客户QQ" &"</td>"&"<td bgcolor='#E2E745'>"& s_oicq &"</td>"&"</tr>"
response.write "<tr>"&"<td bgcolor='#FFCC00'>"&"<p>私服类型" &"</td>"&"<td bgcolor='#E2E745'>"& s_type &"</td>"&"</tr>"
response.write "<tr>"&"<td bgcolor='#FFCC00'>"&"<p>私服线路" &"</td>"&"<td bgcolor='#E2E745'>"& s_line &"</td>"&"</tr>"
response.write "<tr>"&"<td bgcolor='#FFCC00'>"&"<p>私服主页" &"</td>"&"<td bgcolor='#E2E745'>"& s_web &"</td>"&"</tr>"
response.write "<tr>"&"<td bgcolor='#FFCC00'>"&"<p>推荐级别" &"</td>"&"<td bgcolor='#E2E745'>"& s_pic &"</td>"&"</tr>"
response.write "<tr>"&"<td bgcolor='#FFCC00'>"&"<p>私服简述" &"</td>"&"<td bgcolor='#E2E745'>"& s_area &"</td>"&"</tr>"&"</table>"
else
conn.rollbacktrans '取消事物处理
response.write "修改失败,请输入正确的信息。"
response.write "<a href='insert_form.asp'>返回重新添加</a>"
end if
%>
错误是在事物处理 两条SQL语句 第一条没有进行删除 第二条进行了添加
谁能帮帮看看哪出错了
[此贴子已经被作者于2005-10-4 3:18:53编辑过]