看看这个?

SEASKYLONG 2003-08-20 03:35:51
大伙帮我看看这段代码在那里不行了.我试了好多次,找不出原因.我是新手一个.谢谢啦
<%
if session("admin_name")="" then response.end
set rs=server.createobject("adodb.recordset")
%>
<!--#include file="conn.asp"--><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href=../style.css rel=STYLESHEET type=text/css>
</head>

<%
if request("action")="save" then
hw_name=request("hw_name")
hw_content=request("hw_content")
hw_cash=request("hw_cash")
hw_pic=request("hw_pic")
sort_id=request("sort_id")
hw_oldcash=request("hw_oldcash")
if not(isnumeric(hw_cash)) then
errmsg="<br>"+"<li>货物的价格应该为数字"
founderr=true
end if
if hw_name="" then
errmsg=errmsg+"<br>"+"<li>货物名称不能为空"
founderr=true
end if
if hw_content="" then
errmsg=errmsg+"<Br>"+"<li>货物介绍不能为空"
founderr=true
end if
if sort_id="" then
errmsg=errmsg+"<br>"+"<li>货物类别不能为空"
founderr=true
end if
if hw_oldcash="" then
errmsg=errmsg+"<br>"+"<li>货物原价不能为空"
founderr=true
end if


if hw_pic="" then hw_pic="images/noimage.gif"

if founderr=true then
response.write errmsg
response.write "<br>"
response.write "<a href=addhw.asp>返回</a>"
response.end
else
hw_name=server.htmlencode(hw_name)
hw_name=replace(hw_name," "," ")
hw_name=replace(hw_name,chr(13)&chr(10),"<Br>")


hw_content=server.htmlencode(hw_content)
hw_content=replace(hw_content," "," ")
hw_content=replace(hw_content,chr(13)&chr(10),"<Br>")

hw_pic=server.htmlencode(hw_pic)

sql="select * from hw "
rs.open sql,conn,3,3
rs.addnew
rs("hw_name")=hw_name
rs("hw_content")=hw_content
rs("hw_cash")=hw_cash
rs("sort_id")=sort_id
rs("hw_oldcash")=hw_oldcash
rs("hw_pic")=hw_pic
rs.update
rs.close
response.write "货物添加成功"
response.write "<br>"
response.write "<a href=addhw.asp>返回</a>"

end if


else
%>




<table border="0" width="100%" cellspacing="1">
<tr>
<td width="100%">
<form method="POST" action="addhw_save.asp">
<table border="0" width="100%" cellspacing="1">
<tr>
<td width="100%">商品类别<select size="1" name="sort_id">
<%
sql="select * from sort"
rs.open sql,conn,3,3
if rs.eof then
%><option value=""></option>
<%else
do while not rs.eof%>
<option value="<%=rs("sort_id")%>"><%=rs("sort_name")%></option><%rs.movenext
loop
end if
rs.close%>
</select></td>
</tr>
<tr>
<td width="100%">商品名称<input type="text" name="hw_name" size="20" class=input></td>
</tr>
<tr>
<td width="100%">商品原价<input type="text" name="hw_oldcash" size="20" class=input></td>
</tr>
<tr>
<td width="100%">商品价格<input type="text" name="hw_cash" size="20" class=input><font color="#FF0000">不支持小数,小数点后四舍五入</font></td>
</tr>
<tr>
<td width="100%">商品介绍</td>
</tr>
<tr>
<td width="100%"><textarea rows="9" name="hw_content" cols="77" class=input></textarea></td>
</tr>
<tr>
<td width="100%">商品图片<input type="text" name="hw_pic" size="46" class=input></td>
</tr>
</table>
<p><input type="submit" value="提交" name="B1" class=input><input type="reset" value="全部重写" name="B2" class=input></p>
</form>
<iframe name="ad" frameborder=0 width=100% height=195 scrolling=no src=upload.asp></iframe> </td>
</tr>
</table>
<%
end if
set rs=nothing
conn.close
set conn=nothing
%>
...全文
47 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaobaowu 2003-08-20
  • 打赏
  • 举报
回复
我人很懒*^_^* 没有主页啦。
有什么问题就到这问吧,会有很多人帮你的。
SEASKYLONG 2003-08-20
  • 打赏
  • 举报
回复
看过很多次了.你有没有主页啊?
xiaobaowu 2003-08-20
  • 打赏
  • 举报
回复
http://www.aspsky.net/
上有很多的ASP源程序下载,你去那看看吧。
SEASKYLONG 2003-08-20
  • 打赏
  • 举报
回复
大哥有没有什么联系方法啊??
xiaobaowu 2003-08-20
  • 打赏
  • 举报
回复
当然是给我的越多越好啦*^_^*
SEASKYLONG 2003-08-20
  • 打赏
  • 举报
回复
要多少分快说,我们结贴啦..呵.
SEASKYLONG 2003-08-20
  • 打赏
  • 举报
回复
搞点啦.谢谢啦..
那里有ASP源程序下载啊?大哥给几个好的吧.
xiaobaowu 2003-08-20
  • 打赏
  • 举报
回复
具体的就是你的代码的67行了。
xiaobaowu 2003-08-20
  • 打赏
  • 举报
回复
应该是 sql="select * from hw "
rs.open sql,conn,3,3
rs.addnew
rs("hw_name")=hw_name
rs("hw_content")=hw_content
rs("hw_cash")=hw_cash
rs("sort_id")=sort_id
rs("hw_oldcash")=hw_oldcash
rs("hw_pic")=hw_pic
这一段出错了,你看看表中有没有这些字段,或者是不是字段名写错了。
SEASKYLONG 2003-08-20
  • 打赏
  • 举报
回复
sorry .原来还有这个功能啊.呵.
SEASKYLONG 2003-08-20
  • 打赏
  • 举报
回复
ADODB.Recordset 错误 '800a0cc1'

项目在所需的名称或序数中未被发现。

/administrator/addhw.asp,行67
xiaobaowu 2003-08-20
  • 打赏
  • 举报
回复
晕,这有什么用呀。
你先把IE选项中的“显示友好HTTP错误信息”前的勾去掉,再把错误信息给我们看看。
SEASKYLONG 2003-08-20
  • 打赏
  • 举报
回复
无法显示网页
您要访问的网页有问题,无法显示。

--------------------------------------------------------------------------------

请尝试以下操作:

打开 127.0.0.1 主页,然后查找指向您感兴趣信息的链接。
单击刷新按钮,或以后再试。

单击搜索,寻找 Internet 上的信息。
也可查看相关站点列表。




HTTP 500 - 内部服务器错误
Internet Explorer

有时就是这个了.不知道怎么会事了.
liuzxit 2003-08-20
  • 打赏
  • 举报
回复
哇﹗吃完一噸飯都還沒看完
SEASKYLONG 2003-08-20
  • 打赏
  • 举报
回复
无法找到网页
您正在搜索的网页可能已经删除、更名或暂时不可用。

--------------------------------------------------------------------------------

请尝试下列操作:

如果您在“地址”栏中键入了网页地址,请检查其拼写是否正确。

打开 127.0.0.1 主页,寻找指向所需信息的链接。
单击后退按钮尝试其他链接。
HTTP 404 - 无法找到文件
Internet 信息服务


--------------------------------------------------------------------------------

技术信息(支持个人)

详细信息:
Microsoft 支持

jiejifeng 2003-08-20
  • 打赏
  • 举报
回复
哪行出错
hfkj 2003-08-20
  • 打赏
  • 举报
回复

reidli 2003-08-20
  • 打赏
  • 举报
回复
这也太困难了吧,好歹你把错误的提示写出来吧,这样怎么找错误呀
无爱大叔 2003-08-20
  • 打赏
  • 举报
回复
出错信息是什么?

28,391

社区成员

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

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