重新贴这段代码<% dim conn dim connstr dim db db="article.mdb" Set conn = Server.CreateObject("ADODB.Connection") connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"") conn.Open connstr %> <% dim rs,sql dim softname dim bbh dim softlen dim softlx dim softpt dim writer dim url1 dim errmsg dim url2 dim softimg dim softtext dim founerr founerr=false
if trim(request.form("softname"))="" then founderr=true errmsg="<li>软件名称不能为空</li>" end if if trim(request.form("bbh"))="" then founderr=true errmsg=errmsg+"<li>版本号不能为空</li>" end if if trim(request.form("softlen"))="" then founderr=true errmsg=errmsg+"<li>软件大小不能为空</li>" end if if trim(request.form("softlx"))="" then founderr=true errmsg=errmsg+"<li>软件类型不能为空</li>" end if if trim(request.form("writer"))="" then founderr=true errmsg=errmsg+"<li>联系方式不能为空</li>" end if if trim(request.form("url1"))="" then founderr=true errmsg=errmsg+"<li>软件下载地址不能为空</li>" end if %>
<% if trim(request.form("softtext"))="" then founderr=true errmsg=errmsg+"<li>软件介绍不能为空</li>" end if set rs=server.createobject("adodb.recordset") if request("action")="add" then call newsoft() %> <% sub addnews() sql="select * from article where (articleid is null)" rs.open sql,conn,1,3 rs.addnew rs("softname")=softname '软件名称 rs("bbh")=bbh '版本号 rs("softlen")=softlen '软件大小 rs("softlx")=softlx '软件类型,如共享,免费等。。 rs("writer")=writer '作者联系方式 rs("softpt")=softpt '运行平台 rs("url1")=url1 '下载地址1 rs("url2")=url2 '下载地址2 rs("softimg")=softimg '软件界面 rs("softtest")=softtext '软件介绍 if request.form("writer")<>"" then rs("writer")=trim(request.form("writer")) end if
rs.update articleid=rs("articleid") %> <% end sub %><% rs.close set rs=nothing conn.close set conn=nothing %>
在工具internet选项里面 高级勾上显示友好http错误信息.就可以看到错误信息了.if request("action")="add" then call newsoft() 这个newsoft()是在哪儿,下面只有addnews()request("action")除了有add外还有什么,看不出,代码太多了,晕了~~~~~~~~~~~
不行,iis上也设了返回错误,internet上也设置了显示友好错误if request("action")="add" then只有一个add动作 newsoft是一个误笔,改好了还是不行! 我只需要一个简单的写入数据库 改成这样也不行! <% sql="select * from article where (articleid is null)" rs.open sql,conn,1,3 rs.addnew rs("softname")=softname '软件名称 rs("bbh")=bbh '版本号 rs("softlen")=softlen '软件大小 rs("softlx")=softlx '软件类型,如共享,免费等。。 rs("writer")=writer '作者联系方式 rs("softpt")=softpt '运行平台 rs("url1")=url1 '下载地址1 rs("url2")=url2 '下载地址2 rs("softimg")=softimg '软件界面 rs("softtest")=softtext '软件介绍 rs.update articleid=rs("articleid")%><% rs.close set rs=nothing conn.close set conn=nothing %>
no way ,加了set rs = Server.CreateObject("ADODB.Recordset")也不行! 我真的要晕倒了,怎么觉得asp比delphi还要难!! set rs = Server.CreateObject("ADODB.Recordset") sql="select * from article where (articleid is null)" rs.open sql,conn,1,3 rs.addnew
dim conn
dim connstr
dim db
db="article.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
conn.Open connstr
%>
<%
dim rs,sql
dim softname
dim bbh
dim softlen
dim softlx
dim softpt
dim writer
dim url1
dim errmsg
dim url2
dim softimg
dim softtext
dim founerr
founerr=false
if trim(request.form("softname"))="" then
founderr=true
errmsg="<li>软件名称不能为空</li>"
end if
if trim(request.form("bbh"))="" then
founderr=true
errmsg=errmsg+"<li>版本号不能为空</li>"
end if
if trim(request.form("softlen"))="" then
founderr=true
errmsg=errmsg+"<li>软件大小不能为空</li>"
end if
if trim(request.form("softlx"))="" then
founderr=true
errmsg=errmsg+"<li>软件类型不能为空</li>"
end if
if trim(request.form("writer"))="" then
founderr=true
errmsg=errmsg+"<li>联系方式不能为空</li>"
end if if trim(request.form("url1"))="" then
founderr=true
errmsg=errmsg+"<li>软件下载地址不能为空</li>"
end if %>
<% if trim(request.form("softtext"))="" then
founderr=true
errmsg=errmsg+"<li>软件介绍不能为空</li>"
end if
set rs=server.createobject("adodb.recordset")
if request("action")="add" then
call newsoft() %>
<% sub addnews()
sql="select * from article where (articleid is null)"
rs.open sql,conn,1,3
rs.addnew
rs("softname")=softname '软件名称
rs("bbh")=bbh '版本号
rs("softlen")=softlen '软件大小
rs("softlx")=softlx '软件类型,如共享,免费等。。
rs("writer")=writer '作者联系方式
rs("softpt")=softpt '运行平台
rs("url1")=url1 '下载地址1
rs("url2")=url2 '下载地址2
rs("softimg")=softimg '软件界面
rs("softtest")=softtext '软件介绍
if request.form("writer")<>"" then
rs("writer")=trim(request.form("writer"))
end if
rs.update
articleid=rs("articleid")
%>
<%
end sub %><% rs.close
set rs=nothing
conn.close
set conn=nothing
%>
call newsoft()
这个newsoft()是在哪儿,下面只有addnews()request("action")除了有add外还有什么,看不出,代码太多了,晕了~~~~~~~~~~~
newsoft是一个误笔,改好了还是不行!
我只需要一个简单的写入数据库
改成这样也不行!
<%
sql="select * from article where (articleid is null)"
rs.open sql,conn,1,3
rs.addnew
rs("softname")=softname '软件名称
rs("bbh")=bbh '版本号
rs("softlen")=softlen '软件大小
rs("softlx")=softlx '软件类型,如共享,免费等。。
rs("writer")=writer '作者联系方式
rs("softpt")=softpt '运行平台
rs("url1")=url1 '下载地址1
rs("url2")=url2 '下载地址2
rs("softimg")=softimg '软件界面
rs("softtest")=softtext '软件介绍
rs.update
articleid=rs("articleid")%><% rs.close
set rs=nothing
conn.close
set conn=nothing
%>
软件名称
版本号
软件大小
软件类型
作者联系方式
运行平台
下载地址1
下载地址2
软件界面
软件介绍
欢迎来www.smslove.cc/forum交流
rs("softname")=trim(request.form("softname"))另外articleid=rs("articleid")这个是不用addnew的,如果是用access让它类型为自动编号就行了.
我真的要晕倒了,怎么觉得asp比delphi还要难!!
set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from article where (articleid is null)"
rs.open sql,conn,1,3
rs.addnew
此时是用IUSR_YOURCOMPUTER的身份在服务器执行.
检查此用户是否被禁止了.还有会不会是它的权限不足以打开数据库.
<%
sql="select * from article where (articleid is null)"
这个不要就行了.