ASP添加问题

来源:百度知道 编辑:UC知道 时间:2024/06/15 15:14:31
Sql = "Select * from Table_Msg where msg_email='"&session("user_id")&"' and msg_subject='"&msg_subject&"' and msg_content='"&msg_content&"' "
rs.open sql,conn,1,3
if not rs.bof and not rs.eof then
response.write "<script>alert('您提交的标题有重复!');history.go(-1);</script>"
response.end
else
rs.addnew
rs("msg_subject") = Request.Form("msg_subject")
……………………
我提交后他提示
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]The text, ntext, and image data types cannot be used in the WHERE, HAVING, or ON clause, except with the LIKE or IS NULL predicates.

/add_04.asp,行120
120行就是rs.open sql,conn,1,3
我把and msg_content='"&msg_content&"' 去掉就行了。
麻烦高手帮帮忙。

因为我的msg_content 是在线编辑器,不是那种input,请问我该怎么判断呢。

你看看你的msg_content在数据库中的类型。不要用ntext,用varchar.gg,问题解决了就不理我了是不是,好歹给我选为最佳答案啊。

字段类型有问题.改成text去掉n就行了.

但实际上,你后面那段确实没有加上去的必要,你想判断标题和内容都不要重复,可是内容有一点点小小的变化,就会没用,多一个标点都不一样了.这样判断会增加很多运行时间,由其是大文章

一般判断标题就行了.发表文章是需要人工维护的.