| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1223 人关注过本帖
标题:[开源][讨论][求助]asp语句有一部分总是跳过
只看楼主 加入收藏
guaishi
Rank: 1
等 级:新手上路
帖 子:156
专家分:0
注 册:2007-6-15
结帖率:100%
收藏
 问题点数:0 回复次数:12 
[开源][讨论][求助]asp语句有一部分总是跳过

下面这段代码为什么总不执行跳转到 <a href="searchResult.asp?keywords=<%=rb("corpuser_info.username")%>"> <%=rb("corpuser_info.username")%></a> 这上一句请问如何改或

<table width="962" border="0" align="center" cellpadding="0" cellspacing="0" class="CONTENT" bgcolor="#FFFFFF">

<td width="960"></tr>
<tr>
<td height="24"><table width="778" border="0" cellspacing="0" cellpadding="0">
<tr>
<% set rb=server.createobject("adodb.recordset")
id=request("id")
sql="select * from corp_producttype,corpuser_info where corp_producttype.id='"&id&"' and corp_producttype.guanlian in(corpuser_info.jobFunction1,corpuser_info.jobFunction2,corpuser_info.jobFunction3)"
rb.open sql,conn,1,1
if rb.recordcount<>"" then
%>
<a href="searchResult.asp?keywords=<%=rb("corpuser_info.username")%>"> <%=rb("corpuser_info.username")%></a>
<%
id=request("id")
if len(id)=6 then%>
<%set rs = server.CreateObject("adodb.recordset")
sql = "SELECT * FROM corp_producttype where parent="&id&""
rs.open sql,conn,1,1
%>
<a href="searchResult.asp?keywords=<%=rb("corpuser_info.username")%>"> <%=rb("corpuser_info.username")%></a>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="6%"><img src="images/arrow01.gif" width="9" height="12" align="absmiddle"></td>
<td width="94%"><a href="searchResult.asp?keywords=<%=rb("corpuser_info.username")%>"> <%=rb("corpuser_info.username")%></a>
</table>
<%else%>
<%set rs = server.CreateObject("adodb.recordset")
sql = "SELECT * FROM corp_producttype where parent="&id&""
rs.open sql,conn,1,3
%><%if rb.recordcount<>"" then
%>
<% if len(id)=2 or len(id)=4 then%>
<a href="producttype_list.asp?id=<%=rs("id")%>" class="link4"><%=rs("corp_producttype")%><%=rb.recordcount%><%response.write("公司")%></a></td>
<% do while not rs.eof %>


<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="6%"><img src="images/arrow01.gif" width="9" height="12" align="absmiddle"></td>
<td width="94%">
<%rs.movenext%>

<%loop%>
<% else%>
<%
response.redirect "searchResult.asp?keywords="&rb("corpuser_info.username")
%>


<%end if%>
<%end if%>
<% end if%>
<% end if%> </tr>

搜索更多相关主题的帖子: 语句 asp 开源 username 
2007-09-21 14:00
guaishi
Rank: 1
等 级:新手上路
帖 子:156
专家分:0
注 册:2007-6-15
收藏
得分:0 
回复:(guaishi)[开源][讨论][求助]asp语句有一部分...

怪石 15:56:26
其实我的那个程序是想实现这样的操作
有两个表一个分类表,记录分类的信息,有三级分类
另外是一个公司中选择产品的列表
公司可以任意思选取三项
现在想实现从分类中得到该类中有多少家公司选择了
并输出公司相关信息

怪石 15:57:30
公司选取的是一个数值编号对应分类表中的guanlian
怪石 15:58:40
我通过sql语句可以正常显示公司的数量
就是现在无法输出公司的信息那句输出语句不被调用呀
黒馬黃子 15:59:49
你意思是说guanlian字段里的内容和corpuser_info表里的三个字段做对比?
怪石 16:00:10
是的

怪石 16:00:23
他们的值是相同的
黒馬黃子 16:00:51
如果相同会怎样?不相同又怎样?
怪石 16:01:12
得到guanlian的值就可以得到公司选的主品名称
怪石 16:02:43
相同就记录公司有公司选取了这种产品/类
并想办法输出
通过类来输出所有选取所有满足条件的值
怪石 16:02:59
就是通过分类输出公司

黒馬黃子 16:05:38
<%=rb.recordcount%><%response.write("公司")%>
你这个是显示多少家公司?
怪石 16:06:04
是呀
可以正常显示的
现在想要输出公司的信息就出了问题


网络改变了我,编程改变了我的生活
2007-09-23 16:06
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
收藏
得分:0 
sql="select * from corp_producttype,corpuser_info where corp_producttype.id='"&id&"' and corp_producttype.guanlian in(corpuser_info.jobFunction1,corpuser_info.jobFunction2,corpuser_info.jobFunction3)"
上面这样写,下面却写成这样,你的id到底是什么类型?
sql = "SELECT * FROM corp_producttype where parent="&id&""
如果是自动编号,则上面改写成这样试试
sql="select * from corp_producttype,corpuser_info where corp_producttype.id="&id&" and corp_producttype.guanlian in(select jobFunction1,jobFunction2,Funtion3 from corpuser_info)"


2007-09-23 19:34
guaishi
Rank: 1
等 级:新手上路
帖 子:156
专家分:0
注 册:2007-6-15
收藏
得分:0 
sql数据库的不是自动编号的

网络改变了我,编程改变了我的生活
2007-09-24 09:15
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 
你的问题不是已经解决了嘛

[编程论坛] ASP超级群:49158383  敲门暗号:ASP编程
龍艺博客 http://www.
2007-09-24 09:22
guaishi
Rank: 1
等 级:新手上路
帖 子:156
专家分:0
注 册:2007-6-15
收藏
得分:0 

还没有呢
正在想办法


网络改变了我,编程改变了我的生活
2007-09-24 09:32
guaishi
Rank: 1
等 级:新手上路
帖 子:156
专家分:0
注 册:2007-6-15
收藏
得分:0 
图片附件: 游客没有浏览图片的权限,请 登录注册

图片附件: 游客没有浏览图片的权限,请 登录注册

图片附件: 游客没有浏览图片的权限,请 登录注册

上面是执行显示的结果
不知道为什么就是不能跳转

网络改变了我,编程改变了我的生活
2007-09-24 12:47
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
if rb.recordcount>0 then
这个属性应该是数字类型
而且楼主如果判断记录集是否为空
也可以写
if rb.eof then
另外跳转
用Response.Redirect "[URL地址]"
的方式在服务器端进行跳转
2007-09-24 14:15
guaishi
Rank: 1
等 级:新手上路
帖 子:156
专家分:0
注 册:2007-6-15
收藏
得分:0 

不明白你的意思在服务器跳转和客户端跳转没有什么不同呀


网络改变了我,编程改变了我的生活
2007-09-24 14:55
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
if rb.recordcount>0 then
%>
<a href="searchResult.asp?keywords=<%=rb("corpuser_info.username")%>"> <%=rb("corpuser_info.username")%></a>
那楼主满足这个条件后继续执行后面的代码还是跳转到searchResult.asp页面?
2007-09-24 15:02
快速回复:[开源][讨论][求助]asp语句有一部分总是跳过
数据加载中...
 
   



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

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