日期:2014-05-17  浏览次数:20862 次

求助:Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: '*' 附近有语
错误类型:
Microsoft   OLE   DB   Provider   for   ODBC   Drivers   (0x80040E14)
[Microsoft][ODBC   SQL   Server   Driver][SQL   Server]第   1   行:   '* '   附近有语法错误。
/1/2002716114847_75960/公司通讯录/Jaddress1.0/addrdel.asp,   第   14   行
程序如下:

<!--#include   file= "db.asp "-->
<!--#include   file= "session.asp "-->
<%sort=request.Form( "sort ")
id=request.Form( "id ")
if   sort= "comp "   then
strSql   =   "delete   *   from   cp   where   id= "&   id
conn.Execute   strSql
strSql   =   "delete   *   from   address   where   cmp= ' "&   id
conn.Execute   strSql
conn.Close
      response.redirect   "listcomp.asp "
else
strSql   =   "delete   *   from   address   where   id= "&   id
conn.Execute   strSql     <--------出错行
conn.Close
      response.redirect   "listmember.asp "
      end   if%>

看了很久,不知什么地方错了,请高手指教,谢谢!


------解决方案--------------------
strSql = "delete * from address where id= "& id
conn.Execute strSql <--------出错行
去掉*就可以了
strSql = "delete from address where id= "& id
conn.Execute strSql <--------出错行

楼主应该跟我一样也是初学的吧,以后遇到这样的问题不要盯着这一行看,看看跟这个有关的东西的语法,祝你好运,如果交流可以加我QQ43996741