| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1284 人关注过本帖
标题:为什么我查询总是只能查询到一个人的信息?
只看楼主 加入收藏
q6010829
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-2
收藏
 问题点数:0 回复次数:13 
为什么我查询总是只能查询到一个人的信息?

初次接触ASP 做了个比较简单的查询界面
为什么我随便用哪个登陆名查询 都只能查询到同一个人的资料啊?
大概意思就是这样 有碰到过同样问题的朋友吗? 有知道的大侠吗?
知道麻烦跟我说下
加我QQ说也可以 6010829 顺便还可以教我点知识 呵呵
加的时候麻烦著名一下是本论坛朋友 谢谢

搜索更多相关主题的帖子: 查询 
2007-06-02 04:44
ml3300
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2006-4-16
收藏
得分:0 
你把你的代码发上来大家看看啊
不过据推测你应该是没循环
2007-06-02 06:58
lq7350684
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:5089
专家分:98
注 册:2006-11-6
收藏
得分:0 
楼上正解.
2007-06-02 08:39
恒天
Rank: 1
等 级:新手上路
威 望:2
帖 子:165
专家分:0
注 册:2007-6-1
收藏
得分:0 
2楼说的没错
2007-06-02 10:45
laoshu1
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2007-4-14
收藏
得分:0 
顶一下!都对!!
2007-06-02 11:27
q6010829
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-2
收藏
得分:0 

Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("username") <> "") Then
Recordset1__MMColParam = Request.QueryString("username")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT * FROM dbo.usertable WHERE username = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth

Dim MM_removeList
Dim MM_item
Dim MM_nextItem

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If

MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next

' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function

2007-06-02 13:48
q6010829
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-2
收藏
得分:0 
上面就是代码了 剩下的只有页面基本的代码和数据集的绑定 就没发了
麻烦各位老大给分析一下 谢谢
2007-06-02 13:50
enlangs
Rank: 1
等 级:等待验证会员
威 望:2
帖 子:218
专家分:0
注 册:2007-5-28
收藏
得分:0 

初少确认你的[CODE]Request.QueryString("username")[/CODE]没有取到值..把你前面的一个页面代码发出来..

2007-06-02 14:33
q6010829
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-6-2
收藏
得分:0 
我也知道应该是没取到值。。可就是不知道该怎么把值从注册页面传过去。。
哎 刚学的 啥都不懂
2007-06-02 15:27
guyer
Rank: 2
等 级:新手上路
威 望:5
帖 子:451
专家分:0
注 册:2007-1-19
收藏
得分:0 
文件.asp?username=值

http://www./
2007-06-02 15:29
快速回复:为什么我查询总是只能查询到一个人的信息?
数据加载中...
 
   



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

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