关于ASP的一个问题,大家帮忙看下哪里错了吧,谢谢了!

来源:百度知道 编辑:UC知道 时间:2024/09/23 05:59:04
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->

<%
id=trim(Request("id"))

%>

<%
if Request.QueryString("mark")="southidc" then
content=Request("content")
set rs=server.createobject("adodb.recordset")
sql="insert into service (content) values('"& content &"') where serviceclassid="&id
conn.execute sql
rs.close
Set rs=Nothing
response.redirect "Admin_server.asp?id=1"
end if
%>

<%
sql="select * from service where serviceclassid="&id
Set rs_server= Server.CreateObject("ADODB.Recordset")
rs_server.open sql,conn,1,1
%>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing=&q

错误提示是什么?干脆直接Hi我吧,比较快。

sql="insert into service (content) values('"& content &"') where serviceclassid="&id

改为

sql="Update service Set content='"& content &"' where serviceclassid="&id

大哥,你是更新数据啊,不是插入数据,SQL语句不对,你写的SQL语句变成插入数据了,插入数据语句也写错了,插入数据一般不需要where子句

表面上没有什么错误 这一种情况一般是 接值错误 或者类型错误 ,不过最好吧错误提示发来

在这句中sql="insert into service (content) values('"& content &"') ,将表content两边的括号改成“[]”

和谐