出现这种错误是因为你的sql语句有问题而导致的!!在此之前加一句:
Response.Write(sql)然后屏幕掉该句
'conn.execute(sql)将该sql语句打出来,到“查询分析器”上执行一下,看是什么问题!!!

解决方案 »

  1.   

    查询分析器的结果是这样的:[Microsoft][ODBC SQL Server Driver]语法错误或访问冲突是数据源的问题吗?
      

  2.   

    <%@  Language = "VBScript"  %>
    <!-- #Include file="..\include\adovbs.inc" -->
    <!-- #Include file="..\include\cod_ado.inc" -->
    <%
    strTitle = Request.Form("title")
    strTitle = Trim(strTitle)
    strTitle = replace(strTitle,"'","''")

    strTitle = server.HTMLEncode(strTitle)
    'strTitle = replace(strTitle,"<","&lt;")
    'strTitle = replace(strTitle,">","&gt;") strflag_attention = Request.Form("flag_attention")
    if strflag_attention = "on" then
    flag_attention = 1
    else
    flag_attention = 0
    end if

    strText = Request.Form("detail")
    strText = replace(strText,"'","''")

    'strText = server.HTMLEncode(strText)
    'strText = replace(strText,chr(13)&chr(10),"<br>")
    'strText = replace(strText," ","&nbsp;")

    strText = replace(strText,"<","&lt;")
    strText = replace(strText,">","&gt;")

    dim objCnn,rs
    strDSN = "dsn=newdata;uid=;pwd=;"
    strSQL = "SELECT MAX(idnum) from board"
    cod_AdoOpen objCnn,rs,strDSN,strSQL if isnull(rs(0)) then
    idnum=1
    else
    idnum=rs(0)+1
    end if
    rs.close

    strSQL = "insert into board(IDNUM,title,flag_attention,detail) values (" &idnum &",'" &strTitle & "'," & flag_attention & ",'" & strText & "')"
    'Response.Write strSql
    objCnn.Execute(strSQL)  提示是这一句的问题! objCnn.close
    set objCnn = nothing

    response.redirect "bulletin.asp"
    %>
      

  3.   

    报这个错误应该是SQL里登陆用户的问题,看看你的程序,你连接到SQL的用户名和密码怎么都是空呀?你连接到SQL的用户对board这个表要有权限才行呀!
      

  4.   

    因为设了匿名用户所以用户名和密码为空
    这里IDnum是自动编号,加了标记后就没有问题了
      

  5.   

    多半是你的SQL语句有问题
    看看数据类型是否和表里的相匹配