回 帖 发 新 帖 刷新版面

主题:无法向数据库中添加信息,有谁知道原因啊。

哪位帮我看看这面的这些代码哪些地方错了,为什么添加不了信息呢?
<%
  dim action,str,rs,founderror,classname
  action=Request("action")
  classname=Request("bigclass")
  if action="add" then
    if classname="" then
    founderror=true
    Response.Write("<script language='javascript'>alert('栏目不能为空');</script>")
    end if
    if founderror<>true then
    set rs=Server.CreateObject("Adodb.Recordset")
    str="select * from class"
    rs.addnew
    rs("bigclass")=classname
    rs("time")=Now()
    rs.Update
    call closeconn(conn)
    call closers(rs)
    end if
  end if
%>

回复列表 (共2个回复)

沙发

没有打开数据库连接
str="select * from class"
加上
  rs.open str,conn,1,3
 rs.addnew

板凳


虽然您的说法不正确,但是我还是很感激您,谢谢您的关注!!
答案我已经找到了,原来是我的库设置有点错误!
www.cnxx8.com

我来回复

您尚未登录,请登录后再回复。点此登录或注册