asp代码找错

dukuizhen 2009-12-12 11:47:29
<!-- #include file="../conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<%
set rst=server.CreateObject("adodb.recordset")
rst.open "zxly",conn,1,3
rst.addnew
rst("kname")=trim(request.Form("name"))
rst("ktel")=trim(request.Form("tel"))
rst("ktitle")=trim(request.Form("zhuti"))
dim strLy
strLy=trim(request.Form("liuyanneirong"))
%>
<%
Function FullChinese(str)
Dim i
i=len(str)
If i=0 Then
FullChinese=False

Exit Function
End If
Do While i>0
If Asc(Mid(str,i,1))<10000 And Asc(Mid(str,i,1))>-10000 Then
FullChinese=False
Exit Function
End If
i=i-1
Loop
FullChinese=True
End Function
%>
<%
if(FullChinese(strLy)=true) then
rst("kcontent")=strLy
else
response.Write"<script > alert('请返回输入正确的中文,谢谢合作!');history.back();</script>"
end if

if trim(request.Form("yanzhengma"))="" And CStr(Session("GetCode")) <> CStr(request.Form("yanzhengma")) then
response.Write "<script > alert('请返回输入正确的验证码,谢谢合作!');history.back();</script>"
end if
rst.update
rst.close
set rst=nothing
response.Write "<script> alert('提交成功!我们会及时给您回复,请浏览本站查收...');window.location.href='http://localhost/zxly.asp';</script>"


%>
</body>
</html>
为什么没有存入到数据库呢
...全文
169 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
dukuizhen 2009-12-12
  • 打赏
  • 举报
回复
有rst.update
weizewang 2009-12-12
  • 打赏
  • 举报
回复
rst.update
好像没这句吧?
dukuizhen 2009-12-12
  • 打赏
  • 举报
回复
zxly是一个数据库名
Dogfish 2009-12-12
  • 打赏
  • 举报
回复
rst.open "zxly",conn,1,3

zxly是什么来的?
R_zhanche 2009-12-12
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 yan11cn 的回复:]
引用 8 楼 dukuizhen 的回复:
我是楼主,zxly是一个数据库的表的名称,rst.open "zxly",conn,1,3有错误吗?

恩 比如说你要返回表zxly的所有列,应该这么写:
dim sql
sql ="select * from zxly"
rst.open sql,conn,1,3

[/Quote]

uo
yan11cn 2009-12-12
  • 打赏
  • 举报
回复
楼上说的对 学习了
syjeffdyg 2009-12-12
  • 打赏
  • 举报
回复
菜鸟这么多,
rs.open 参数1,conn,A,B
参数1可以是表名,也可以是SQL,不要误导楼主。
gxq323 2009-12-12
  • 打赏
  • 举报
回复
这错误,网上随便搜一下很多,没碰到过,自己试了
yan11cn 2009-12-12
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 dukuizhen 的回复:]
我是楼主,zxly是一个数据库的表的名称,rst.open "zxly",conn,1,3有错误吗?
[/Quote]
恩 比如说你要返回表zxly的所有列,应该这么写:
dim sql
sql ="select * from zxly"
rst.open sql,conn,1,3
dukuizhen 2009-12-12
  • 打赏
  • 举报
回复
去掉on error resume next报错
错误类型:
Microsoft JET Database Engine (0x80004005)
不能使用 '';文件已在使用中。
E:\MYWEBSITE\SAVE\../conn.asp, 第 15 行
dukuizhen 2009-12-12
  • 打赏
  • 举报
回复
我是楼主,zxly是一个数据库的表的名称,rst.open "zxly",conn,1,3有错误吗?
yan11cn 2009-12-12
  • 打赏
  • 举报
回复
楼上正解
gxq323 2009-12-12
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 dogfish 的回复:]
rst.open"zxly",conn,1,3

zxly是什么来的?
[/Quote]这个应该不对, zxly这个参数应该是填sql语句的,你要是变量的话就不能加引号
gxq323 2009-12-12
  • 打赏
  • 举报
回复
注释掉on error resume next看看报的什么错误

28,406

社区成员

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

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