| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1014 人关注过本帖
标题:[Microsoft][ODBC SQL Server Driver][SQL Server] '=' 附近有语法错误
只看楼主 加入收藏
sweetwly
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2006-1-2
收藏
 问题点数:0 回复次数:3 
[Microsoft][ODBC SQL Server Driver][SQL Server] '=' 附近有语法错误
<%@ language="vbscript" %>
<%
dim author,ip_addr,theme,pic_path,content,id
dim cnn,sSQL
author=trim(Request.Form("txtAuthor"))
ip_addr=Request.ServerVariables("REMOTE_ADDR")
theme=trim(Request.Form("txtTheme"))
pic_path=Request.Form("optPic")
content=trim(Request.Form("txtContent"))
id=Request.Form("id")
if author=" " or theme=" " or content=" " then
Server.Transfer="replyTheme.asp"
end if
%>
<html>
<head>
<title>回复已提交</title>
</head>
<body>
<! --#include virtual="/adovbs.inc -->
<%
set cnn=Server.CreateObject("ADODB.Connection")
cnn.ConnectionString="driver={SQL Server};server=ME;uid=sa;pwd=;database=test"
cnn.Open
sSQL="update articles set reply_times=reply_times+1 where art_id= " & id
cnn.Execute sSQL, , adCmdText
sSQL="insert replies(author,ip_addr,theme,pic_path,content,re_id)"
sSQL=sSQL & "values('" & author & "','" & ipaddr & "','"
sSQL=sSQL & theme & "','"&"images/" & pic_path & "','" &conten &"',id)"
cnn.Execute sSQL, ,adCmdText
%>
<p><b>回复提交成功!</b></p>
<p>[<a href="forum.asp">返回论坛首页</a>]</p>
</body>
</html>
调试时,红色的那行代码老是报这样的错误:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: '=' 附近有语法错误。
为什么呀?
搜索更多相关主题的帖子: SQL Microsoft ODBC Driver Server 
2006-03-30 16:35
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:0 
reply_times是什么类型的字段?时间型的吗?

本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2006-03-30 18:23
sweetwly
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2006-1-2
收藏
得分:0 

不是时间型的,是int型的,是用来描述被回复的次数.

2006-03-30 20:21
lengguting
Rank: 1
等 级:新手上路
帖 子:42
专家分:0
注 册:2006-3-27
收藏
得分:0 
看看你的数据库里有没有写错的地方
2006-03-31 15:48
快速回复:[Microsoft][ODBC SQL Server Driver][SQL Server] '=' 附近有语法错误 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014451 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved