asp调用access,数据不能更新,即不能保存,但又不会提示有错误,打开数据库看数据也没有保存到
Setrsa=Server.CreateObject("ADODB.Recordset")sql="select*fromFeedback"rsa.opensql,con...
Set rsa = Server.CreateObject("ADODB.Recordset")
sql="select * from Feedback"
rsa.open sql,conn,1,3
rsa.addnew
rsa("CompanyName")=request.form("CompanyName")
rsa("Add")=trim(request.form("Add"))
rsa("Postcode")=trim(request.form("Postcode"))
rsa("Receiver")=trim(request.form("Receiver"))
rsa("Phone")=trim(request.form("Phone"))
rsa("Mobile")=trim(request.form("Mobile"))
rsa("Fax")=trim(request.form("Fax"))
rsa("Email")=trim(request.form("Email"))
rsa("Title")=trim(request.form("Title"))
rsa("Content")=htmlencode2(request.form("Content"))
rsa("Publish")=trim(request.form("Publish"))
rsa("Time")=date()
rsa.update
rsa.requery
rsa.close 展开
sql="select * from Feedback"
rsa.open sql,conn,1,3
rsa.addnew
rsa("CompanyName")=request.form("CompanyName")
rsa("Add")=trim(request.form("Add"))
rsa("Postcode")=trim(request.form("Postcode"))
rsa("Receiver")=trim(request.form("Receiver"))
rsa("Phone")=trim(request.form("Phone"))
rsa("Mobile")=trim(request.form("Mobile"))
rsa("Fax")=trim(request.form("Fax"))
rsa("Email")=trim(request.form("Email"))
rsa("Title")=trim(request.form("Title"))
rsa("Content")=htmlencode2(request.form("Content"))
rsa("Publish")=trim(request.form("Publish"))
rsa("Time")=date()
rsa.update
rsa.requery
rsa.close 展开
2个回答
展开全部
你用标准的t-sql语言试一下
<!--#include file="conn.asp"-->
<%
dim sql
sql="insert into Feedback (CompanyName,Add,Postcode,Receiver,Phone,Mobile,Fax,Email,Title,Content,Publish,Time) value('"&request.form("CompanyName")
&"','"&trim(request.form("Add"))
&"','"&trim(request.form("Postcode"))
&"','"&trim(request.form("Receiver"))
&"','"&trim(request.form("Phone"))
&"','"&trim(request.form("Mobile"))
&"','"&trim(request.form("Fax"))
&"','"&trim(request.form("Email"))
&"','"&trim(request.form("Title"))
&"','"&htmlencode2(request.form("Content"))
&"','"&trim(request.form("Publish"))&"',date())"
set rsa=Server.CreateObject("ADODB.Recordset")
conn.execute(sql)
%>
还不行的话就是你所在文件夹不容许修改或者你其他的代码有误,也或许是你的IIS配置,win7大多数是IIS没有配置合适
<!--#include file="conn.asp"-->
<%
dim sql
sql="insert into Feedback (CompanyName,Add,Postcode,Receiver,Phone,Mobile,Fax,Email,Title,Content,Publish,Time) value('"&request.form("CompanyName")
&"','"&trim(request.form("Add"))
&"','"&trim(request.form("Postcode"))
&"','"&trim(request.form("Receiver"))
&"','"&trim(request.form("Phone"))
&"','"&trim(request.form("Mobile"))
&"','"&trim(request.form("Fax"))
&"','"&trim(request.form("Email"))
&"','"&trim(request.form("Title"))
&"','"&htmlencode2(request.form("Content"))
&"','"&trim(request.form("Publish"))&"',date())"
set rsa=Server.CreateObject("ADODB.Recordset")
conn.execute(sql)
%>
还不行的话就是你所在文件夹不容许修改或者你其他的代码有误,也或许是你的IIS配置,win7大多数是IIS没有配置合适
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询