求购烈焰之鳞:ASP提交数据库无法添加问题

来源:百度文库 编辑:高校问答 时间:2024/04/28 07:13:30
我修改了一个后台ASP程序,其它的版块连数据库都可以添加修改,但是有一个下载中心版块,我输入完了数据当提交后提示提交成功,没有错误,不过却没有任何东西添加到数据库,请教一下这是什么原因,都用同一个数据库连接,其它能用,它为什么不能用,肯请高手们帮忙!以下是添加时的代码:
<!--#include file="Admin.asp"-->
<!--#include file="Conn.asp"-->
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass_down order by SmallClassID asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.addNEWS.SmallClassName.length = 1;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.addNEWS.SmallClassName.options[document.addNEWS.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
function CheckForm()
{
document.addNEWS.cnWords.value = document.frames.cnEditBox.getHTML(true);
document.addNEWS.imageNum.value = document.frames.cnEditBox.document.all("editImageNum").value;
document.addNEWS.editFirstImageName.value = document.frames.cnEditBox.document.all("editFirstImageName").value;
if (document.addNEWS.title.value.length == 0) {
alert("新闻标题没有填写.");
document.addNEWS.title.focus();
return false;
}
if (document.addNEWS.user.value.length == 0) {
alert("新闻发布人没有填写");
document.addNEWS.user.focus();
return false;
}
return true;
}
</script>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top">
<div align="center">
<table width="90%" border="0" cellpadding="0" bgcolor="#E1F4EE">
<form name="addNEWS" method="post" action="Down_add_ok.asp" onSubmit="return CheckForm();">
我急用,请高手一定帮忙!能解决者还有分数赠送!
这是Down_load_ok.asp文件:

set rs=server.createobject("adodb.recordset")
sql="select * from Download where (id is null)"
rs.open sql,conn,1,3
rs.addnew
rs("title")=title
rs("BigClassName")=BigClassName
rs("SmallClassName")=SmallClassName
rs("content")=mcontent
rs("System")=System
rs("Softclass")=Softclass
rs("PhotoUrl")=PhotoUrl
rs("DownloadUrl")=DownloadUrl
rs("FileSize")=FileSize

if mimageNum<>"" then rs("imageNum") = mimageNum
if firstImageName<>"" then rs("firstImageName") = firstImageName
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<script language='javascript'>" & chr(13)
response.write "alert('下载提交成功!');" & Chr(13)
response.write "window.document.location.href='Down_Manage.asp';"&Chr(13)
response.write "</script>" & Chr(13)
Response.End
%>

主要是在Down_add_ok.asp这个里边
你看看Down_add_ok.asp
或许会找到错误
上边执行的对像是Down_add_ok.asp

Down_add_ok.asp里面出现问题了,action的意思是将你现在的页面提交到你的action页面里,这样就可以实现ASP了,仔细找找你的Down_add_ok.asp里面,看看是SQL错了还是ASP,不行的话就贴出来,明天我还跟你的贴

问题不是出现在你的conn.asp里面,是出现在Down_add_ok.asp里面啊!

用这个语句可以UPDATE
aaa=request.form("")
bbb=request.form("")
sql="update 数据表名 set 项目='"&aaa&"'"where 项目='"&bbb&"'"
conn.excute sql

你贴出来的代码里没有相关的插入数据库的代码