asp使用access库的程序不能修改记录,求救高手解决

来源:百度知道 编辑:UC知道 时间:2024/06/14 19:01:09
我有个程序想实现修改记录,可是修改完提交后,数据记录没变,不知道是哪里出问题了,请高手帮忙看看。
<%
select case request("action")
case "edit"
call edit
end select

sub edit
dim id
if Request("id")="" then
Response.Redirect "hy.asp"
end if
id=request("id")
newpin2=trim(LCase(Request("newpin")))
oldpin=md5(trim(LCase(Request("oldpin"))))
newpin=md5(trim(LCase(Request("newpin"))))
email=trim(LCase(Request("email")))
name=trem(LCase(Request("name")))
lxdizi=trim(Request("lxdizi"))
tel1=trim(LCase(Request("tel1")))
tel2=trim(LCase(Request("tel2")))
faxx=trim(LCase(Request("faxx")))
qqhm=trim(LCase(Request("qqhm")))
dengji=Request("dengji")
senhe=Request("senhe")
jifen=request("jifen&quo

如果是记录没有更新多数是你的id值没获取到

if Request("id")="" then
Response.Redirect "hy.asp"
end if

改成
if Request("id")="" then
Response.write(Request("id"))
end if 可以测试你的id值有没有获取到

如果是用from传的ID值 最好是用request.form("id")
如果是直接传的参数就用request.Query("id")

if Request("id")="" then
最好改成
if Not IsNumeric(Request("id")) then ‘测试id是不是数值型
还不行 就在
rs.update
后面加 rs.updatebatch
仔细检查数据库查询语句 错个字母或符号都 不行

你写了一个提示,那它有没有提示你呢,你说的问题我没找到,但是提醒你一下:if Request("id")="" then
Response.Redirect "hy.asp"
end if
这句话最好写成这样:
If Request("id")="" OR isNull(Request("id")) Then
Response.Redirect "hy.asp"
Response.End//重要的是这句,一定要加上,不然会有意想不到错误
End If

提供有偿调试服务,如需可百度HI我。