录入文章时出现的问题

thisisll 2003-06-15 10:19:06
我编了一段录入文章的代码

但是在录入的文章内容比较多时就出现错误
技术信息(用于支持人员)

错误类型:
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 ''a series of 一系列,一连串 above all 首先,尤其是 after all 毕竟,究竟 ahead of 在...之前 ahead of time 提前 all at once 突然,同时 all but 几乎;除了...都 all of a sudden 突然 all over 遍及 all over again 再一次,重新 all the time 一直,始终 all the same 仍然,照样的 as regards 关于,至于 anything ' 中。
/addd.asp, 第 18 行


代码如下
<!-- #Include File=Conn.asp -->

<%if session("adpass")<>"passed" then
response.redirect "loginadmin.asp"
end if

title = Request("title")
kind = Request("kind")
content = Request("content")


If kind = "" or title="" Then
response.write "<script language=JavaScript>" & "alert('题目和内容不能为空!');" & "history.back()" & "</script>"
response.end
end if

sql="insert into data (title,content,kind) values ('"&title&"','"&content&"','"&kind&"')"
set rs=conn.execute (sql)《------------------------------------------18行

conn.Close
Set conn=Nothing
Response.Write "<html><body><center>文章添加成功,请确认后返回!<p>"
Response.Write "<a href='artmanage.asp'>返回查看</a>"
Response.Write "</center></body></html>"
%>


请哥哥姐姐们帮忙看看
谢谢啊
...全文
73 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
caoshangfei 2003-06-15
  • 打赏
  • 举报
回复
你的文本里可能有单引号啊。
thisisll 2003-06-15
  • 打赏
  • 举报
回复
??
thisisll 2003-06-15
  • 打赏
  • 举报
回复
但是我录入比较短的文章时没问题啊
caoshangfei 2003-06-15
  • 打赏
  • 举报
回复
你用sql语句插入的???应该替换掉其中的单引号。。
thisisll 2003-06-15
  • 打赏
  • 举报
回复
我看书了
上面说字符串长在0---大约20亿字节
还有我在修改文章时给他加了很多文字比录入时要多很多就是不出问题
可是录入时稍微多些就出错了
caoshangfei 2003-06-15
  • 打赏
  • 举报
回复
文本字段又不是万能的,怎么可能你想要存多少文字就存多少文字吧。在录入的时候你应该判定一下,if len(content)>某个数 then
thisisll 2003-06-15
  • 打赏
  • 举报
回复
那有什么解决的方法吗??
xjy521 2003-06-15
  • 打赏
  • 举报
回复
就是单引号问题

28,409

社区成员

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

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