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

请教一个asp问题
错误类型:
Microsoft   VBScript   编译器错误   (0x800A0408)
无效字符
/xitong/lunwen/addsave.asp,   line   6,   column   20
rs.open   sql,conn,1,3 

代码:
<%@LANGUAGE= "VBScript "   codepage= "936 "%>    
<!--#include   file= "conn.asp "-->     
<%
set   rs=server.CreateObject( "adodb.recordset ")
sql= "select   user,email,content   from   main "
rs.open   sql,conn,1,3 
rs.addnew
    
rs( "user ")=request.form( "user ")    
rs( "email ")=request.form( "email ")    
rs( "content ")=request.form( "content ")
   
rs.update
rs.close
  
set   rs=nothing    
conn.close
   
set   conn=nothing    
%>

数据库已设计为完全控制状态,完全用半角

------解决方案--------------------
conn打开没?
------解决方案--------------------

这样写试试
select [user],email,content from main
------解决方案--------------------
<%
set rs=server.CreateObject( "adodb.recordset ")
sql= "select [user],email,content from main where 1=0 "
rs.open sql,conn,1,3 
rs.addnew
rs( "user ")=request.form( "user ")    
rs( "email ")=request.form( "email ")    
rs( "content ")=request.form( "content ")
rs.update
rs.close
set rs=nothing    
conn.close
set conn=nothing    
%>
------解决方案--------------------
如果conn连接是对的

sql= "select user,email,content from main "
rs.open sql,conn,1,3

换成这样试试

Rs.Open "select * from main ",conn,1,3
------解决方案--------------------
sql= "select user,email,content from main "
response.write(sql)
response.end()
这样输出一下SQL语句看看有毛病没?