在记录集中排序 [英] Ordering in Record Set

查看:69
本文介绍了在记录集中排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当存在冗余时,记录集如何排序?

我的例子是如果您在数据库中搜索客户,但有两个或更多客户具有相同的名称,即约翰·史密斯。我想显示每个John Smith的联系信息,但目前我只能获得第一个John Smith的数据。


目前我的设置如下:

地址1 = rs(3)

地址2 = rs(4)

城市= rs(5)

州= rs(6)


你可以想象其余的。使用其他代码,我可以收到所有名称的名称,因为我得到了很多记录,但联系人数据是相同的。 rs如何工作以便我可以编写代码?

How does a Record Set order the when there is redundancy?
The example I have is if you search a DB for a customer, but there are two or more customers with the same name, i.e John Smith. I want to show the contact info for each John Smith, but currently I can only get the data to show up for the first John Smith.

Currently I have it setup up like this:
Address1 = rs(3)
Address2 = rs(4)
City = rs(5)
State = rs(6)

You can imagine the rest. With other code I can receive the names for all the names, because I get that many records, but the contact data is the same. How does the rs work so I can code this?

推荐答案

您必须发布您正在使用的实际代码。恐怕我无法理解到目前为止发布的内容。我知道它可能对你有意义,但是没有足够的信息让任何人了解你在做什么或出了什么问题。


Mary
You will have to post the actual code you are using. I''m afraid I can''t follow what''s happening from what you''ve posted so far. I know that it probably makes sense to you but there is not enough information there for anyone to understand what you are doing or what is going wrong.

Mary

和Mary一样,我真的不能按照你的解释。

但是,我猜你想要在你的记录集中返回所有记录它们匹配您选择的名称。

在这种情况下(因为您还没有提供任何相关信息)我假设您在表单上有一个名为txtName的TextBox中进行选择(我们'为了清楚起见,请打电话给我。我还假设你的数据在表tblCust中找到。
Like Mary, I can''t really follow your explanation.
However, I''ll guess that you want to return all records in your recordset where they match your selected name.
In this case (as you haven''t supplied any information for this) I''m assuming you have the selection in a TextBox called txtName on your form (we''ll call frmCust for clarity). I''ve also assumed your data is found in the table tblCust.
展开 | 选择 | Wrap | 行号


我很抱歉没有发布所有的码。所以再一次,我的问题是,如果我有两个John Smiths,记录集如何对数据进行排序。现在它只改变了DistID,没有别的。我该如何解决。你去吧。

I very sorry for not posting all the code. So once again, my question is, if I have two John Smiths, how does the Record Set order the data. Right now it only changes the DistID, and nothing else. How do I fix this. Here you go.

展开 | 选择 | Wrap | 行号


这篇关于在记录集中排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆