关于ASP+access 数据库中其中一个表单数据不能写入,更新,可以读出,删除 20
<%action=Trim(Request.QueryString("action"))ifaction="add"thenuname=Request.Cookies("...
<%
action=Trim(Request.QueryString("action"))
if action="add" then
uname=Request.Cookies("admin_company_name")
cname=ReplaceBadChar(Trim(Request.Form("cname")))
jobname=ReplaceBadChar(Trim(Request.Form("jobname")))
renshu=ReplaceBadChar(Trim(Request.Form("renshu")))
jobtext=ReplaceBadChar(Trim(Request.Form("jobtext")))
fmoney=ReplaceBadChar(Trim(Request.Form("fmoney")))
lastjtime=ReplaceBadChar(Trim(Request.Form("lastjtime")))
workplace=ReplaceBadChar(Trim(Request.Form("workplace")))
jobtype=ReplaceBadChar(Trim(Request.Form("jobtype")))
lxname=ReplaceBadChar(Trim(Request.Form("lxname")))
lxphone=ReplaceBadChar(Trim(Request.Form("lxphone")))
lxemail=ReplaceBadChar(Trim(Request.Form("lxemail")))
set rs1=server.createobject("adodb.recordset")
sql1="select * from freejz "
rs1.open sql1,conn,3,3
rs1.addnew
rs1("uname")=uname
rs1("cname")=cname
rs1("jobname")=jobname
rs1("renshu")=renshu
rs1("jobtext")=jobtext
rs1("fmoney")=fmoney
rs1("lastjtime")=lastjtime
rs1("workplace")=workplace
rs1("jobtype")=jobtype
rs1("lxname")=lxname
rs1("lxphone")=lxphone
rs1("lxemail")=lxemail
rs1("addjtime")=now()
rs1.update
rs1.close
set rs1=nothing
conn.close
set conn=nothing
response.redirect "jzgl.asp"
end if
%> 展开
action=Trim(Request.QueryString("action"))
if action="add" then
uname=Request.Cookies("admin_company_name")
cname=ReplaceBadChar(Trim(Request.Form("cname")))
jobname=ReplaceBadChar(Trim(Request.Form("jobname")))
renshu=ReplaceBadChar(Trim(Request.Form("renshu")))
jobtext=ReplaceBadChar(Trim(Request.Form("jobtext")))
fmoney=ReplaceBadChar(Trim(Request.Form("fmoney")))
lastjtime=ReplaceBadChar(Trim(Request.Form("lastjtime")))
workplace=ReplaceBadChar(Trim(Request.Form("workplace")))
jobtype=ReplaceBadChar(Trim(Request.Form("jobtype")))
lxname=ReplaceBadChar(Trim(Request.Form("lxname")))
lxphone=ReplaceBadChar(Trim(Request.Form("lxphone")))
lxemail=ReplaceBadChar(Trim(Request.Form("lxemail")))
set rs1=server.createobject("adodb.recordset")
sql1="select * from freejz "
rs1.open sql1,conn,3,3
rs1.addnew
rs1("uname")=uname
rs1("cname")=cname
rs1("jobname")=jobname
rs1("renshu")=renshu
rs1("jobtext")=jobtext
rs1("fmoney")=fmoney
rs1("lastjtime")=lastjtime
rs1("workplace")=workplace
rs1("jobtype")=jobtype
rs1("lxname")=lxname
rs1("lxphone")=lxphone
rs1("lxemail")=lxemail
rs1("addjtime")=now()
rs1.update
rs1.close
set rs1=nothing
conn.close
set conn=nothing
response.redirect "jzgl.asp"
end if
%> 展开
2个回答
展开全部
首先确认action="add"是否为真,然后判断你的这些变量是否都有值,实在不行换一种sql语句写法用insert into试一下,还有就是找一找有没有On Error Resume Next这句,如果有去掉,看有没有错误
追问
On Error Resume Next 没有,在数据库连接语句中有
If Err Then..... 删除之后结果一样,没有报错,页面不显示
insert into 行不通,试了一下,主要问题是要解决rs1("addjtime")=now()
追答
数据库连接语句中On Error Resume Next先注释掉,还有就是“ReplaceBadChar(Trim(”这些去掉试试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询