注册 登录
编程论坛 ASP技术论坛

asp的addnew出错,请大侠帮忙,困扰好几天了。

taotao_52 发布于 2012-04-13 15:24, 599 次点击
addnew.asp
------------------------------------------------------------------
<!--#include file="./conn.asp" -->
<%
'On Error Resume Next
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "select * from cgsqd"
rs.open sql,conn,1,3
rs.addnew
    rs("name")=Request.form("name")
    rs("dept")=Request.form("dept")
    rs("num")=Request.form("num")
    rs("date")=Request.form("date")
rs.update
If Err Then
Err.Clear
rs.close
Set rs = nothing
response.write "插入失败..."
response.write  Err.Description
response.write  Err.Number
Response.End()
End If
Response.Write "<html><body><center><font size=5>祝贺,您的申请单已经添加进数据库了!<p>"
------------------------------------------------------------------
错误信息:

You are not authorized to view this page

You do not have permission to view this directory or page using the credentials you supplied.
------------------------------------------------------
已知的
1.因为有别的asp对数据库的另一个user表能更新密码,数据库权限应该没问题。
2.表名,字段名,form的输入框名再三确认没问题。
5 回复
#2
aspic2012-04-13 17:04
If Err Then
Err.Clear
把这个注释掉 看看提示的错误就知道了
#3
taotao_522012-04-13 17:13
'Err.Clear
注释了,还是一样的错误信息,程序应该没有执行到这里,是什么权限问题呢,我其他asp页对同一数据库的user表都能更新啊
#4
aspic2012-04-14 20:39
是自己机子上测试的吗?
#5
taotao_522012-04-15 11:11
是的,在自己机上
#6
aspic2012-04-16 08:50
在自己机子上应该可以看到具体的错误信息才对啊
1