请帮助查验数据更新脚本 高分回报
无论怎么试,都无法给数据表加新记录,烦请查看我的代码.
<!--#include file="conn.asp"-->
<%
dim Action
dim rs,sql,rsClass,sqlClass
dim ID,BigClassName,SmallClassName,Title,Product_Id,SpecialName,Spec,Newproduct,Price,Unit,Memo,Key,Elite,Passed,Content,IncludePic,massage
Action=trim(request("Action"))
ID=trim(request("ID"))
if Action="Save" then
set rs=server.createobject("adodb.recordset")
sql="select * from product where ID="&ID
rs.open sql,conn,1,1
if rs.eof and rs.bof then
rs.cloase
set rs=nothing
call CloseConn()
response.redirect "ProductManage.asp"
end if
rs("BigClassName")=BigClassName
rs("SmallClassName")=SmallClassName
rs("Product_Id")=Product_Id
rs("SpecialName")=SpecialName
rs("Spec")=Spec
rs("Unit")=Unit
rs("Memo")=Memo
rs("Passed")=Passed
rs("Content")=Content
rs.update
else
if Action="Add" then
BigClassName=trim(request("BigClassName"))
SmallClassName=trim(request("SmallClassName"))
Product_Id=trim(request("Product_Id"))
SpecialName=trim(request("SpecialName"))
Spec=trim(request("Spec"))
Newproduct=trim(request("Newproduct"))
Price=trim(request("Price"))
Unit=trim(request("Unit"))
Memo=trim(request("Memo"))
Key=trim(request("Key"))
Elite=trim(request("Elite"))
Passed=trim(request("Passed"))
Content=trim(request("Content"))
IncludePic=trim(request("IncludePic"))
Title=trim(request("Title"))
BigClassName=trim(request("Title"))
If Title="" Then
response.write "SORRY <br>"
response.write "请输入产品名称!!<a href=""javascript:history.go(-1)"">返回重输</a>"
response.end
end if
If BigClassName="" Then
response.write "SORRY <br>"
response.write "产品大类不能为空!!<a href=""javascript:history.go(-1)"">返回重输</a>"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from product"
rs.open sql,conn,1,3
massage="添加产品"
rs.addnew
rs("BigClassName")=BigClassName
rs("SmallClassName")=SmallClassName
rs("Product_Id")=Product_Id
rs("SpecialName")=SpecialName
rs("Spec")=Spec
rs("Unit")=Unit
rs("Memo")=Memo
rs("Passed")=Passed
rs("Content")=Content
rs.update
rs.cloase
set rs=nothing
call CloseConn()
response.redirect "ProductManage.asp"
else
if Action="Edit" then
set rs=server.createobject("adodb.recordset")
sql="select * from product where ID="&ID
rs.open sql,conn,1,1
if rs.eof and rs.bof then
rs.cloase
set rs=nothing
call CloseConn()
response.redirect "ProductManage.asp"
end if
massage="修改产品"
Action="Save"
else
massage="添加产品"
Action="Add"
end if
end if
end if
%>
<html>
<head>
<title>企业网站管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>
.tes { border:solid; border-width: 0象素 0象素 1象素; border-color: #FFFFFF #FFFFFF #000000}
body,td,th {
font-size: 12px;
color: #666666;
}
</STYLE>
</head>
<body>
<div align="center">
<p><b><font size="5"><%=massage%></font></b></p>
<form method="POST" action="ProductEdit.asp">
<table border="0" id="table1" cellspacing="0" cellpadding="0">
<tr>
<td align="right" style="line-height:20pt">所属大类:</td>
<td>
<%
sqlClass="select * from BigClass"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
if rsClass.eof then
response.Write("还未建立大类")
else
%>
<select size="1" name="BigClassName">
<%
do while not rsClass.eof
%>
<option value="<%=rsClass("BigClassName")%>"><%=rsClass("BigClassName")%></option>
<%
rsClass.movenext
loop
%>
</select>
<%
end if
rsClass.close
set rsClass=nothing
%></td></tr>
<tr>
<td align="right" style="line-height:20pt">所属小类:</td>
<td>
<%
sqlClass="select * from SmallClass"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
if rsClass.eof then
response.Write("还未建立小类")
else
%>
<select size="1" name="SmallClassName">
<%
do while not rsClass.eof
%>
<option value="<%=rsClass("SmallClassName")%>"><%=rsClass("SmallClassName")%></option>
<%
rsClass.movenext
loop
%>
<option value="">不属于任何小类</option>
</select>
<%
end if
rsClass.close
set rsClass=nothing
%></td></tr>
<tr>
<td align="right" style="line-height:20pt">所属专题:</td>
<td>
<%
sqlClass="select * from product where SpeicalName<>''"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
if rsClass.eof then
response.Write("<input type='text' name='SpecialName' size='40' class=tes>")
else
%>
<select size="1" name="SpecialName">
<%
do while not rsClass.eof
%>
<option><%=rsClass("SpecialName")%></option>
<%
rsClass.movenext
loop
%>
</select>
<%
end if
rsClass.close
set rsClass=nothing
%></td></tr>
<tr>
<td align="right" style="line-height:20pt">作为新产品显示:</td>
<td>是<input type="radio" value="y" name="Newproduct">否<input type="radio" value="n" name="Newproduct"></td></tr>
<tr>
<td align="right" style="line-height:20pt">为推荐产品:</td>
<td>是<input type="radio" value="y" name="Elite">否<input type="radio" value="n" name="Elite"></td></tr>
<tr>
<td align="right" style="line-height:20pt">通过审核:</td>
<td>是<input type="radio" value="y" name="Passed">否<input type="radio" value="n" name="Passed"></td></tr>
<tr>
<td align="right" style="line-height:20pt">包含图片:</td>
<td>是<input type="radio" value="y" name="IncludePic">否<input type="radio" value="n" name="IncludePic"></td></tr>
<tr>
<td align="right" style="line-height:20pt">产品售价:</td>
<td><input type="text" name="Price" size="40" class=tes value="<%=rs("Price")%>"></td></tr>
<tr>
<td align="right" style="line-height:20pt">单位:</td>
<td><input type="text" name="Unit" size="40" class=tes value="<%=rs("Unit")%>"></td></tr>
<tr>
<td align="right" style="line-height:20pt">备注:</td>
<td><input type="text" name="Memo" size="40" class=tes value="<%=rs("Memo")%>"></td></tr>
<tr>
<td align="right" style="line-height:20pt">产品内容:</td>
<td><input type="text" name="Content" size="40" class=tes value="<%=rs("Content")%>"></td></tr>
<tr>
<td align="right" style="line-height:20pt">产品名称:</td>
<td><input type="text" name="Title" size="40" class=tes value="<%=rs("Title")%>"></td></tr>
<tr>
<td align="right" style="line-height:20pt">规格:</td>
<td><input type="text" name="Spec" size="40" class=tes value="<%=rs("Spec")%>"></td></tr>
<tr>
<td align="right" style="line-height:20pt">产品编号:</td>
<td><input type="text" name="Product_Id" size="40" class=tes value="<%=rs("Product_Id")%>"></td></tr>
<tr>
<td align="right" style="line-height:40pt">产品图片:</td>
<td><iframe style="top:2px" ID="UploadFiles" src="../upload_Photo.asp?PhotoUrlID=3" frameborder=0 scrolling=no width="300" height="25"></iframe></td></tr>
</table>
<p></p>
<input type="submit" value="提交" name="B1"> <input type="reset" value="重置" name="B2"><input type=hidden value="<%=Action%>" name="Action">
</form>
</div>
<%
rs.close
set rs=nothing
call CloseConn()
%>
</body>
</html>
<!--#include file="conn.asp"-->
<%
dim Action
dim rs,sql,rsClass,sqlClass
dim ID,BigClassName,SmallClassName,Title,Product_Id,SpecialName,Spec,Newproduct,Price,Unit,Memo,Key,Elite,Passed,Content,IncludePic,massage
Action=trim(request("Action"))
ID=trim(request("ID"))
if Action="Save" then
set rs=server.createobject("adodb.recordset")
sql="select * from product where ID="&ID
rs.open sql,conn,1,1
if rs.eof and rs.bof then
rs.cloase
set rs=nothing
call CloseConn()
response.redirect "ProductManage.asp"
end if
rs("BigClassName")=BigClassName
rs("SmallClassName")=SmallClassName
rs("Product_Id")=Product_Id
rs("SpecialName")=SpecialName
rs("Spec")=Spec
rs("Unit")=Unit
rs("Memo")=Memo
rs("Passed")=Passed
rs("Content")=Content
rs.update
else
if Action="Add" then
BigClassName=trim(request("BigClassName"))
SmallClassName=trim(request("SmallClassName"))
Product_Id=trim(request("Product_Id"))
SpecialName=trim(request("SpecialName"))
Spec=trim(request("Spec"))
Newproduct=trim(request("Newproduct"))
Price=trim(request("Price"))
Unit=trim(request("Unit"))
Memo=trim(request("Memo"))
Key=trim(request("Key"))
Elite=trim(request("Elite"))
Passed=trim(request("Passed"))
Content=trim(request("Content"))
IncludePic=trim(request("IncludePic"))
Title=trim(request("Title"))
BigClassName=trim(request("Title"))
If Title="" Then
response.write "SORRY <br>"
response.write "请输入产品名称!!<a href=""javascript:history.go(-1)"">返回重输</a>"
response.end
end if
If BigClassName="" Then
response.write "SORRY <br>"
response.write "产品大类不能为空!!<a href=""javascript:history.go(-1)"">返回重输</a>"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from product"
rs.open sql,conn,1,3
massage="添加产品"
rs.addnew
rs("BigClassName")=BigClassName
rs("SmallClassName")=SmallClassName
rs("Product_Id")=Product_Id
rs("SpecialName")=SpecialName
rs("Spec")=Spec
rs("Unit")=Unit
rs("Memo")=Memo
rs("Passed")=Passed
rs("Content")=Content
rs.update
rs.cloase
set rs=nothing
call CloseConn()
response.redirect "ProductManage.asp"
else
if Action="Edit" then
set rs=server.createobject("adodb.recordset")
sql="select * from product where ID="&ID
rs.open sql,conn,1,1
if rs.eof and rs.bof then
rs.cloase
set rs=nothing
call CloseConn()
response.redirect "ProductManage.asp"
end if
massage="修改产品"
Action="Save"
else
massage="添加产品"
Action="Add"
end if
end if
end if
%>
<html>
<head>
<title>企业网站管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>
.tes { border:solid; border-width: 0象素 0象素 1象素; border-color: #FFFFFF #FFFFFF #000000}
body,td,th {
font-size: 12px;
color: #666666;
}
</STYLE>
</head>
<body>
<div align="center">
<p><b><font size="5"><%=massage%></font></b></p>
<form method="POST" action="ProductEdit.asp">
<table border="0" id="table1" cellspacing="0" cellpadding="0">
<tr>
<td align="right" style="line-height:20pt">所属大类:</td>
<td>
<%
sqlClass="select * from BigClass"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
if rsClass.eof then
response.Write("还未建立大类")
else
%>
<select size="1" name="BigClassName">
<%
do while not rsClass.eof
%>
<option value="<%=rsClass("BigClassName")%>"><%=rsClass("BigClassName")%></option>
<%
rsClass.movenext
loop
%>
</select>
<%
end if
rsClass.close
set rsClass=nothing
%></td></tr>
<tr>
<td align="right" style="line-height:20pt">所属小类:</td>
<td>
<%
sqlClass="select * from SmallClass"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
if rsClass.eof then
response.Write("还未建立小类")
else
%>
<select size="1" name="SmallClassName">
<%
do while not rsClass.eof
%>
<option value="<%=rsClass("SmallClassName")%>"><%=rsClass("SmallClassName")%></option>
<%
rsClass.movenext
loop
%>
<option value="">不属于任何小类</option>
</select>
<%
end if
rsClass.close
set rsClass=nothing
%></td></tr>
<tr>
<td align="right" style="line-height:20pt">所属专题:</td>
<td>
<%
sqlClass="select * from product where SpeicalName<>''"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
if rsClass.eof then
response.Write("<input type='text' name='SpecialName' size='40' class=tes>")
else
%>
<select size="1" name="SpecialName">
<%
do while not rsClass.eof
%>
<option><%=rsClass("SpecialName")%></option>
<%
rsClass.movenext
loop
%>
</select>
<%
end if
rsClass.close
set rsClass=nothing
%></td></tr>
<tr>
<td align="right" style="line-height:20pt">作为新产品显示:</td>
<td>是<input type="radio" value="y" name="Newproduct">否<input type="radio" value="n" name="Newproduct"></td></tr>
<tr>
<td align="right" style="line-height:20pt">为推荐产品:</td>
<td>是<input type="radio" value="y" name="Elite">否<input type="radio" value="n" name="Elite"></td></tr>
<tr>
<td align="right" style="line-height:20pt">通过审核:</td>
<td>是<input type="radio" value="y" name="Passed">否<input type="radio" value="n" name="Passed"></td></tr>
<tr>
<td align="right" style="line-height:20pt">包含图片:</td>
<td>是<input type="radio" value="y" name="IncludePic">否<input type="radio" value="n" name="IncludePic"></td></tr>
<tr>
<td align="right" style="line-height:20pt">产品售价:</td>
<td><input type="text" name="Price" size="40" class=tes value="<%=rs("Price")%>"></td></tr>
<tr>
<td align="right" style="line-height:20pt">单位:</td>
<td><input type="text" name="Unit" size="40" class=tes value="<%=rs("Unit")%>"></td></tr>
<tr>
<td align="right" style="line-height:20pt">备注:</td>
<td><input type="text" name="Memo" size="40" class=tes value="<%=rs("Memo")%>"></td></tr>
<tr>
<td align="right" style="line-height:20pt">产品内容:</td>
<td><input type="text" name="Content" size="40" class=tes value="<%=rs("Content")%>"></td></tr>
<tr>
<td align="right" style="line-height:20pt">产品名称:</td>
<td><input type="text" name="Title" size="40" class=tes value="<%=rs("Title")%>"></td></tr>
<tr>
<td align="right" style="line-height:20pt">规格:</td>
<td><input type="text" name="Spec" size="40" class=tes value="<%=rs("Spec")%>"></td></tr>
<tr>
<td align="right" style="line-height:20pt">产品编号:</td>
<td><input type="text" name="Product_Id" size="40" class=tes value="<%=rs("Product_Id")%>"></td></tr>
<tr>
<td align="right" style="line-height:40pt">产品图片:</td>
<td><iframe style="top:2px" ID="UploadFiles" src="../upload_Photo.asp?PhotoUrlID=3" frameborder=0 scrolling=no width="300" height="25"></iframe></td></tr>
</table>
<p></p>
<input type="submit" value="提交" name="B1"> <input type="reset" value="重置" name="B2"><input type=hidden value="<%=Action%>" name="Action">
</form>
</div>
<%
rs.close
set rs=nothing
call CloseConn()
%>
</body>
</html>
...全文
相关推荐
InvoiceSpider:国家税务总局预算发票查验平台|自动化发票查验
InvoiceSpider是一个可以自动化模拟在查验发票的项目。停止更新2020年4月以来,查验平台进行了多次更新,增加了多个加密参数,本人是在校学生,吞吐量有限,查验平台转化速度太快,我慎重考虑之后
增值税发票查验API接口说明
通过返回的数据包,可以获取详细的发票信息,包括但不限于发票代码、发票号码、查验时间、发票类型等。此外,不同的发票类型有不同的校验规则,系统会根据这些规则进行校验并返回相应的结果。
AresonMouseTestProgram可测鼠标回报率及DPI
首先,我们来了解一下鼠标的回报率。回报率,也称为刷新率,是指鼠标每秒向电脑发送位置更新报告的次数,通常以Hz为单位。例如,一个具有125Hz回报率的鼠标,每秒会报告125次位置变化。
pip更新所有python可更新库的脚本
python库更新脚本,通过sh加此脚本存储地址可执行,使用到的更新工具为pip,更新前请先安装pip
firefox_update:该脚本可帮助您在debian GNU linux上安装更新的Firefox
firefox_update 该脚本可帮助您在debian GNU linux上安装更新的Firefox。 如果您在debian上更新Firefox时遇到问题,请使用此脚本。 特征: 自动检测系统核心


