| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 924 人关注过本帖
标题:实在是不知道原因!求救
只看楼主 加入收藏
luowen882000
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2005-12-20
收藏
 问题点数:0 回复次数:16 
实在是不知道原因!求救

这段代码实现的是:点击相印的歌手后就显现出他的歌曲
sclassid是歌手的在数据库的标识

<!--#include file=conn.asp-->
<%
set rs=server.CreateObject("adodb.recordset")
if request("nclassid")<> "" then
sql="select * from musiclist where nclassid="&request("nclassid")

rs.open sql,conn,1,1/第15行
if rs.eof and rs.bof then
response.Write"<script>alert('没有任何歌曲。')</script>"
else
i=0
do while not rs.eof and rs.bof
i=i+1

%>
<table width="100%" border="0" style="BORDER-TOP : #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid " >
<tr>
<td width="7%" align="center" valign="middle" backround= "/image/ll.gif"><font size="2" face="宋体">选择</font></td>
<td width="42%" background="/image/ll.gif" ><font size="2" face="宋体">歌曲</font></td>
<td width="29%" background="/image/ll.gif" ><font size="2" face="宋体">歌手</font></td>
<td width="22%" background="/image/ll.gif" ><font size="2" face="宋体">试听</font></td>
</tr>

<tr>
<td align="right" valign="middle" bgColor=#e7e3e7><font size="2" face="宋体"><%=rs("id")%></font>.</td>
<td style="BORDER-RIGHT : #000000 1px solid ;BORDER-TOP : #000000 1px solid"><a href="#"><font color="#000000" size="2" face="宋体" STYLE="Text-Decoration:none"><%=rs("musicname")%></font></a></td>
<td style="BORDER-RIGHT : #000000 1px solid ;BORDER-TOP : #000000 1px solid"><a href="#"><font color="#000000" size="2" face="宋体" STYLE="Text-Decoration:none"><%=rs("singer")%></font></a></td>
<td style="BORDER-ROGHT : #000000 1px solid;BORDER-TOP : #000000 1px solid">
<%if rs("wma")<>"" then%>
<a href="#" onclick="MM_openBrWindow('paly.asp?id=<%=rs("id")%>','','width=400,height=25')"><img src="image/21.gif" width="33" height="13" border="0"></a>
<%else
response.Write"<script>alert('未收录歌曲。');window.location.href="index1.asp';</script>"
end if%></td>

</tr>
<%
rs.movenext
loop
end if
rs.close
end if
%>
</table>


运行后 总是报这样的错:
错误类型:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
列名 'nclassid' 无效。
/musiclist.asp, 第 15 行

搜索更多相关主题的帖子: 数据库 color 歌曲 标识 
2005-12-23 18:05
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:0 
sql="select * from musiclist where nclassid="&amp;request("nclassid")有错,nclassid可能写错了

本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2005-12-23 18:07
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
收藏
得分:0 
[QUOTE]sql="select * from musiclist where nclassid="&request("nclassid")[/QUOTE]


改为:
[QUOTE]sql="select * from musiclist where nclassid like '%"&trim(request("nclassid"))&"%'[/QUOTE]



试一下

我是农家的孩子,我有农家孩子的本色!
2005-12-23 18:15
luowen882000
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2005-12-20
收藏
得分:0 

哪里写错了呢?

2005-12-23 18:17
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
收藏
得分:0 
你先试一下嘛!

我是农家的孩子,我有农家孩子的本色!
2005-12-23 18:18
luowen882000
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2005-12-20
收藏
得分:0 
试了
又报这样的错:
错误类型:
Microsoft VBScript 编译器错误 (0x800A0409)
未结束的字符串常量
/musiclist.asp, line 13, column 82
sql="select * from musiclist where nclassid like '%"&trim(request("nclassid"))&"%'

:(
吃饭去了啊
马上回来
呵呵
2005-12-23 18:21
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:0 
以下是引用luowen882000在2005-12-23 18:17:00的发言:

哪里写错了呢?

我怎么知道,可能是表名,也可能是字段名,你应该细心点。不过安楼上的说法,应该没用。


本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2005-12-23 18:24
anjincheng
Rank: 2
等 级:论坛游民
威 望:5
帖 子:728
专家分:31
注 册:2005-7-27
收藏
得分:0 
那你确定您的nclassid是对的吗?

再你的

<%
set rs=server.CreateObject("adodb.recordset")
if request("nclassid")<> "" then
sql="select * from musiclist where nclassid="&request("nclassid")

rs.open sql,conn,1,1/第15行
if rs.eof and rs.bof then
response.Write"<script>alert('没有任何歌曲。')</script>"
else
i=0
do while not rs.eof and rs.bof
i=i+1

%>


没有end if ?

我是农家的孩子,我有农家孩子的本色!
2005-12-23 18:25
luowen882000
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2005-12-20
收藏
得分:0 

我确定nclassid是正确地
瞎好正确!~
我的end if 写在最下面

根据您们的建议
me仔细看看是不是 houjuanjie 说的
没细心造成的

。。。。。。

2005-12-23 18:41
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:0 

你是在conn.asp里定义了数据库连接了吗?


本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2005-12-23 18:47
快速回复:实在是不知道原因!求救
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014323 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved