急!明晚要交工

youyongdemao 2006-07-05 10:49:56
小弟初学ASP,给单位写网站迎接评估,明晚交工,数据库用SQL,不知为什么,老提示出错:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: '《' 附近有语法错误。
错误行代码如下:
var nclassName=Request.form("nclassName")
var strSql="select * from article where content="+nclassName
conn.execute(strSql)
诸位大哥帮忙看一下
...全文
95 5 打赏 收藏 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
边城的刀声 2006-07-05
  • 打赏
  • 举报
回复
用WebEditor进行编辑
youyongdemao 2006-07-05
  • 打赏
  • 举报
回复
谢谢诸位大哥,问题解决了,还有一个问题,从网站后台管理系统粘贴上去的文章,怎样分段正常显示?
ywwr 2006-07-05
  • 打赏
  • 举报
回复
var strSql="select * from article where content="+nclassName
改成
var strSql="select * from article where content="+"'"+nclassName+"'"
试试
bitmaque 2006-07-05
  • 打赏
  • 举报
回复
在页面上打印sql ,查询分析器看看能否出结果
边城的刀声 2006-07-05
  • 打赏
  • 举报
回复
var nclassName=Request.form("nclassName")
var strSql="select * from article where content='"&nclassName&"'"
conn.execute(strSql)
如果你的content是备注型的话,是不能进行比较的

28,402

社区成员

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

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