473,385 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Creating sub-recordsets

How do I create a recordset from another?

e.g.
sSQL1="SELECT * FROM ThisTable"
rs1.open sSQL1,conn

sSQL2="Select * from (rs1?) WHERE name='fred' "
rs2.open sSQL2,conn

TIA
Giles
Jul 22 '05 #1
5 1225
Why don't you just run the second statement to begin with?

Bob Lehmann

"Giles" <Gi***@NoSpam.com> wrote in message
news:e8**************@TK2MSFTNGP14.phx.gbl...
How do I create a recordset from another?

e.g.
sSQL1="SELECT * FROM ThisTable"
rs1.open sSQL1,conn

sSQL2="Select * from (rs1?) WHERE name='fred' "
rs2.open sSQL2,conn

TIA
Giles

Jul 22 '05 #2
The first statement takes about 5 secs to execute. Didn't make myself v
clear - the 1st statement is full of conditions, to a Search database. The
second is to filter and order search results into various categories without
having to make the main trip again.
Giles
"Bob Lehmann" wrote > Why don't you just run the second statement to begin
with?

"Giles" wrote in message
How do I create a recordset from another?

e.g.
sSQL1="SELECT * FROM ThisTable"
rs1.open sSQL1,conn

sSQL2="Select * from (rs1?) WHERE name='fred' "
rs2.open sSQL2,conn

Jul 22 '05 #3
Giles wrote:
How do I create a recordset from another?

e.g.
sSQL1="SELECT * FROM ThisTable"
rs1.open sSQL1,conn

sSQL2="Select * from (rs1?) WHERE name='fred' "
rs2.open sSQL2,conn

Use the recordset's Filter property.

Bob Barrows
PS. Avoid Selstar: http://www.aspfaq.com/show.asp?id=2096
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #4

"Bob Barrows [MVP]" wrote
Giles wrote:
How do I create a recordset from another?

e.g.
sSQL1="SELECT * FROM ThisTable"
rs1.open sSQL1,conn

sSQL2="Select * from (rs1?) WHERE name='fred' "
rs2.open sSQL2,conn

Use the recordset's Filter property.

Bob Barrows
PS. Avoid Selstar: http://www.aspfaq.com/show.asp?id=2096


Thanks Bob. I do avoid * where poss since joining this NG - almost as bad as
top (or bottom) posting! However, the article seems to suggest that if you
want all fields, it is better to explicitly name the lot. Is that right?
Does everyone do that?
Giles
Jul 22 '05 #5
Giles wrote:
"Bob Barrows [MVP]" wrote
Giles wrote:
How do I create a recordset from another?

e.g.
sSQL1="SELECT * FROM ThisTable"
rs1.open sSQL1,conn

sSQL2="Select * from (rs1?) WHERE name='fred' "
rs2.open sSQL2,conn
Use the recordset's Filter property.

Bob Barrows
PS. Avoid Selstar: http://www.aspfaq.com/show.asp?id=2096


Thanks Bob. I do avoid * where poss since joining this NG - almost as
bad as top (or bottom) posting! However, the article seems to suggest
that if you want all fields, it is better to explicitly name the lot.


"seems to suggest"? I thought it was worded strongly enough that it would do
more than "seem to suggest" ,,, :-)
Is that right?
Yes
Does everyone do that?


Everyone who :
a) knows the pitfalls of selstar
b) is not lazy
c) wants to reduce network traffic and the time connected to the database,
resulting in better performance and resource utilization

:-)

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: DaWoE | last post by:
Hi all, I'm fairly new to ASP.NET. What i want to do is creat a online registration form. On the first step is getting the users details and the number of people he wants to register. Based on...
4
by: Coleen | last post by:
Hi All :-) Can anyone give me a URL where I can find a good example of code on how to create a temporary SQL table using VB.net? I've checked the Microsoft site at: ...
2
by: Val3 | last post by:
Hi all. I need to build dll(s) and windows services using VB .NET 2005 Express. When I make File/New project the windows contain only Windows application, Windows control library, Console...
1
by: Joel Whitehouse | last post by:
Hello All, I'm haveing a problem instantiating a form. When I try to instantiate my form and call it's ShowDialog() method, I get the following error message: An unhandled exception of type...
3
by: EnglishMan69 | last post by:
Hello All, I am using VB2005 Beta 2 in VS 2005 and am running into a small problem. I need to be able to add a picture box to the main form from within a thread. The program goes to a web...
1
by: bill | last post by:
I'm using VS2005. I am dynamically adding a Textbox control to a Placeholder control in the page_load event of the form, but the event handler isn't firing. What am I doing wrong? Thanks...
0
by: Lemune | last post by:
Hello everyone. I'm creating windows service application to capture data from my PABX, and send the data to sql server. My question is how could my application know when that PABX is sending data...
5
by: SalamElias | last post by:
I am creating several chkBoxes dynamically and assigning an event handler in the Page_load as foillows ***************************** Dim chkCatOption As CheckBox = New CheckBox chkCatOption.Text...
0
by: PracticalApps | last post by:
I looked to find a canned solution to create a Word document in my application and just couldn't find anything that just gets to the point. I would think, and I may be making too strong of an...
2
by: FFrozTT | last post by:
I am having a problem creating a DLL with an entry point. I've been trying sub Main, DllMain, and I get nothing. When I run dumpbin - exports mydll.dll I see no entry points, also the dll when...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.