大家帮忙看看这段代码到底有错没的!

xyz378704 2005-07-12 10:43:27
提交页面test.asp
保存数据页面save.asp
数据库英文access
结果在国外服务器上测试提交时出现该网页无法显示,到底是程序错了还是服务器原因?
test.asp
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<form name="form1" method="post" action="save.asp">
<table width="50%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="37%"> </td>
<td width="63%"><input name="uname" type="text" id="uname"></td>
</tr>
<tr>
<td> </td>
<td><input name="sex" type="text" id="sex"></td>
</tr>
<tr>
<td> </td>
<td><input name="tel" type="text" id="tel"></td>
</tr>
<tr>
<td>测试</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>

save.asp
<%
dim uname
dim sex
dim tel
uname=request.Form("uname")
sex=request.Form("sex")
tel=request.Form("tel")
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db1.mdb")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from test",oconn,3,3
rs.addnew
rs("uname")=uname
rs("sex")=sex
rs("tel")=tel
rs.update
response.Write("eqwewq")
%>
...全文
74 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
xyz378704 2005-07-12
  • 打赏
  • 举报
回复
没人顶了啊?自己来!
xyz378704 2005-07-12
  • 打赏
  • 举报
回复
对啊,本地不会出现任何错误,是服务器原因?
king2410 2005-07-12
  • 打赏
  • 举报
回复
read-only?
xyz378704 2005-07-12
  • 打赏
  • 举报
回复
错误是这个
更新Cannot update. Database or object is read-only.
本地一切正常,郁闷!!
hj3793 2005-07-12
  • 打赏
  • 举报
回复
先用本地的数据库测试
xyz378704 2005-07-12
  • 打赏
  • 举报
回复
测试了的啊。也可以执行。但是传到国外服务器就不行了啊。什么错误提示也没有
cpforange 2005-07-12
  • 打赏
  • 举报
回复
程序能执行啊,你在本地没测试吗?
看看你的数据库什么的路径有没有问题啊
crycoming 2005-07-12
  • 打赏
  • 举报
回复
看错了,不好意思
你加个错误处理看看出错信息吧

''''
on error resume next

dim uname
dim sex
dim tel
uname=request.Form("uname")
sex=request.Form("sex")
tel=request.Form("tel")
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db1.mdb")

if err<>0 then
response.write "数据连接"
response.write err.description
response.end
end if


set rs=server.CreateObject("adodb.recordset")
rs.open "select * from test",oconn,3,3

if err<>0 then
response.write "数据查询"
response.write err.description
response.end
end if

rs.addnew


rs("uname")=uname
rs("sex")=sex
rs("tel")=tel
rs.update

if err<>0 then
response.write "更新"
response.write err.description
response.end
end if

response.Write("eqwewq")
crycoming 2005-07-12
  • 打赏
  • 举报
回复
set rs=server.CreateObject("adodb.recordset")
'少了
rs.activeconnection=oConn

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧