ASP 表单 写入数据库 的困惑
问题:代码如下,为什么只有把表单全填上,数据库才能更新,只填几项就更新不了?我已经测试过,表单数据能正确传递给相应参数。<%dimlanguage,Username,Ti...
问题:代码如下,为什么只有把表单全填上,数据库才能更新,只填几项就更新不了?我已经测试过,表单数据能正确传递给相应参数。
<%
dim language,Username,Title,Content,CompanyName,Add,Postcode,Receiver,Phone,Mobile,Fax,Email,Publish
language=Request.QueryString("language")
set rs=server.createobject("adodb.recordset")
sql="select * from feedback "
rs.open sql,conn,1,3
Username=request.form("Username")
Title=request.form("Title")
Content=request.form("Content")
CompanyName=request.form("CompanyName")
Add=request.form("Add")
Postcode=request.form("Postcode")
Receiver=request.form("Receiver")
Phone=request.form("Phone")
Mobile=request.form("Mobile")
Fax=request.form("Fax")
Email=request.form("Email")
Publish=request.form("Publish")
rs.addnew
rs("Username")=Username
rs("Title")=Title
rs("Content")=Content
rs("CompanyName")=CompanyName
rs("Add")=Add
rs("Postcode")=Postcode
rs("Receiver")=Receiver
rs("Phone")=Phone
rs("Mobile")=Mobile
rs("Fax")=Fax
rs("Email")=Email
rs("Publish")=Publish
rs.update
rs.close
set rs=nothing
conn.close
%>
<%
abc=language&Username&Title&Content&CompanyName&Add&Postcode&Receiver&Phone&Mobile&Fax&Email&Publish
Response.Write abc
%> 展开
<%
dim language,Username,Title,Content,CompanyName,Add,Postcode,Receiver,Phone,Mobile,Fax,Email,Publish
language=Request.QueryString("language")
set rs=server.createobject("adodb.recordset")
sql="select * from feedback "
rs.open sql,conn,1,3
Username=request.form("Username")
Title=request.form("Title")
Content=request.form("Content")
CompanyName=request.form("CompanyName")
Add=request.form("Add")
Postcode=request.form("Postcode")
Receiver=request.form("Receiver")
Phone=request.form("Phone")
Mobile=request.form("Mobile")
Fax=request.form("Fax")
Email=request.form("Email")
Publish=request.form("Publish")
rs.addnew
rs("Username")=Username
rs("Title")=Title
rs("Content")=Content
rs("CompanyName")=CompanyName
rs("Add")=Add
rs("Postcode")=Postcode
rs("Receiver")=Receiver
rs("Phone")=Phone
rs("Mobile")=Mobile
rs("Fax")=Fax
rs("Email")=Email
rs("Publish")=Publish
rs.update
rs.close
set rs=nothing
conn.close
%>
<%
abc=language&Username&Title&Content&CompanyName&Add&Postcode&Receiver&Phone&Mobile&Fax&Email&Publish
Response.Write abc
%> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询