asp 写不进数据库

来源:百度知道 编辑:UC知道 时间:2024/07/07 09:10:15
做一个需求调查,向数据库提交一些数据。表单项在另一个页面,这是action=""的页面,conn.asp是数据库联接
<!--#include file="conn.asp" -->
<%
dim rs sql
set rs=server.createobject("adodb.recordset")
sql="select * from xqdc where id is null"
rs.open sql,conn,1,3
rs.addnew
rs("c-name")= request("c-name")
rs("c-address")= request("c-address")
rs("c-contact")= request("c-contact")
rs("c-tel")= request("c-tel")
rs("c-email")= request("c-email")
rs("t-content")= request("t-content")
rs("t-time")= request("t-time")
rs("t-target")= request("t-target")
rs.update
rs.close
response.write "<center>您提交的信息已经成功保存了...</center>"
%>
写完后,运行,发现总是提示http500错误,不知道哪里错了?大家帮帮忙!
数据库结构是c-name,c-address.....,sql那句应该怎么改呢?

也许可以参照我的这个答案:
http://zhidao.baidu.com/question/81326996.html

sql="select * from xqdc where id is null"这句啥意思?!没看明白
把 where id is null 去掉应该就没问题了

你把所有的-取掉

你数据库里面是用的c-name,c-address.....
吗?我看到上面没什么问题.应该是这个问题吧!

sql="select * from xqdc where id is null"
这句不对

我遇到的问题与此类似,只是rs.addnew 不能正常运行,提示数据库或数据对象不可更新。
欢迎解答!