473,408 Members | 2,888 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,408 software developers and data experts.

Recordset!

Assume that an ASP page has 3 SQL queries. Can a recordset object be
populated with the records of all these 3 queries at the same time?

Please note that the 3 queries are distinct queries, not related to
each other in any way. Also please note that I am not talking about
populating the recordset with the records of the 1st query, then
closing it & again opening that recordset, populating it with the
records of the 2nd query so on & so forth.

Thanks,

Arpan

Oct 17 '05 #1
7 1643
Sure if all the fields are of exactly the same type in each part.

Union
http://www.w3schools.com/sql/sql_union.asp

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips

<<
Assume that an ASP page has 3 SQL queries. Can a recordset object be
populated with the records of all these 3 queries at the same time?

Please note that the 3 queries are distinct queries, not related to each
other in any way. Also please note that I am not talking about
populating the recordset with the records of the 1st query, then closing
it & again opening that recordset, populating it with the records of the
2nd query so on & so forth.


*** Sent via Developersdex http://www.developersdex.com ***
Oct 17 '05 #2
Not really.* Are they coming from the same database? You could union the
queries on the database server.

Ray at work

* Yes, actually you can if you really want to, but why on Earth...?
"Arpan" <ar******@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Assume that an ASP page has 3 SQL queries. Can a recordset object be
populated with the records of all these 3 queries at the same time?

Please note that the 3 queries are distinct queries, not related to
each other in any way. Also please note that I am not talking about
populating the recordset with the records of the 1st query, then
closing it & again opening that recordset, populating it with the
records of the 2nd query so on & so forth.

Thanks,

Arpan

Oct 17 '05 #3
No not if they are not related

but simply use 3 recordsets
"Arpan" <ar******@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Assume that an ASP page has 3 SQL queries. Can a recordset object be
populated with the records of all these 3 queries at the same time?

Please note that the 3 queries are distinct queries, not related to
each other in any way. Also please note that I am not talking about
populating the recordset with the records of the 1st query, then
closing it & again opening that recordset, populating it with the
records of the 2nd query so on & so forth.

Thanks,

Arpan

Oct 18 '05 #4

"Arpan" <ar******@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Assume that an ASP page has 3 SQL queries. Can a recordset object be
populated with the records of all these 3 queries at the same time?

Please note that the 3 queries are distinct queries, not related to
each other in any way. Also please note that I am not talking about
populating the recordset with the records of the 1st query, then
closing it & again opening that recordset, populating it with the
records of the 2nd query so on & so forth.

Thanks,

Arpan


Hi Arpan,

I think you have 3 Different SQL Query and dont want to use 3 recordset but
you want to open / populate ONLY ONE recordset that consistes of all 3 SQL
Query?

If that is the case then use NextRecordset method of ADO. Let me know if
this help.

Thanks
Prabhat
Oct 18 '05 #5
"Arpan" <ar******@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Assume that an ASP page has 3 SQL queries. Can a recordset object be
populated with the records of all these 3 queries at the same time?

Please note that the 3 queries are distinct queries, not related to
each other in any way. Also please note that I am not talking about
populating the recordset with the records of the 1st query, then
closing it & again opening that recordset, populating it with the
records of the 2nd query so on & so forth.


I have three tables for a What's On database - Dates, Classes and Hosts.
It's a MS Access database and I use ASP with VBScript to generate results
for a web page.

Dates is a table of dates with a link to Classes via ClassID.
Classes contains details of the event with a link to Hosts via HostName.
Hosts contains details of who is hosting the event.

If a date is listed then there must be a corresponding event set up. Not
every event has a host. I use the following SQL query to dump results into a
single recordset. I'm no expert so make of it what you will. All polite
criticism appreciated. :-)

SELECT *
FROM Hosts
RIGHT JOIN
(Classes INNER JOIN Dates ON Classes.ClassID=Dates.ClassID)
ON Hosts.HostName=Classes.HostName
WHERE (add your filters here)
AND (add another filter here if you like)
ORDER BY (sort the results)

Oct 18 '05 #6
Prabhat wrote:
"Arpan" <ar******@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Assume that an ASP page has 3 SQL queries. Can a recordset object be
populated with the records of all these 3 queries at the same time?

Please note that the 3 queries are distinct queries, not related to
each other in any way. Also please note that I am not talking about
populating the recordset with the records of the 1st query, then
closing it & again opening that recordset, populating it with the
records of the 2nd query so on & so forth.

Thanks,

Arpan


Hi Arpan,

I think you have 3 Different SQL Query and dont want to use 3
recordset but you want to open / populate ONLY ONE recordset that
consistes of all 3 SQL Query?

If that is the case then use NextRecordset method of ADO. Let me know
if this help.

THis will not work with Access, which does not support batch queries. Of
course, since we don't know what database is being used ...

Arpan, please. Always specify the database type and version you are using in
EVERYdatabase-related post you make. Do not assume that we will know your
database by your previous posts:
a) we may not have read your previous posts
b) you may be using a database that is different from the one used in your
previous posts

You will avoid receiving unusable replies if you remember to do this. Make
it a header that you copy/paste into each of your questions to the group.

As Ray mentioned, it may be possible to construct a union query that will
retrieve your results in a single recordset. However, this will only work if
the queries are all being run in the same database (Access) or on the same
server (SQL Server)
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Oct 18 '05 #7

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:u9**************@TK2MSFTNGP14.phx.gbl...

THis will not work with Access, which does not support batch queries. Of
course, since we don't know what database is being used ...

Arpan, please. Always specify the database type and version you are using in EVERYdatabase-related post you make. Do not assume that we will know your
database by your previous posts:
a) we may not have read your previous posts
b) you may be using a database that is different from the one used in your
previous posts

You will avoid receiving unusable replies if you remember to do this. Make
it a header that you copy/paste into each of your questions to the group.

As Ray mentioned, it may be possible to construct a union query that will
retrieve your results in a single recordset. However, this will only work if the queries are all being run in the same database (Access) or on the same
server (SQL Server)
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Yes that will not work on MS Access.

Oct 18 '05 #8

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

Similar topics

0
by: gary artim | last post by:
Hi All, I have a problem using DBIx::RecordSet. I get correct results but continue to get these messages on stderr. I looked at Compat.pm and it seems to be pointing out a problem with my call...
4
by: Tom | last post by:
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use...
19
by: Adam Short | last post by:
I am trying to write a routine that will connect a .NET server with a classic ASP server. I know the following code doesn't work! The data is being returned as a dataset, however ASP does not...
0
by: CFW | last post by:
I thought this was going to be easy but I'm missing something . . . I need to open an ADODB recordset using the recordset source for a list box on my for. When my form opens, the list box ADODB...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
36
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a...
0
ADezii
by: ADezii | last post by:
Most Access Users realize that Recordsets, being virtual representations of a Query, Table, or SQL Statement, exist only in our PC's memory. They, and the data they contain, literally exist at one...
0
ADezii
by: ADezii | last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be: Can I add New Records to the...
6
by: Oko | last post by:
I'm currently developing an MS Access Data Project (.adp) in MS Access 2002. One of the reports within the DB uses data that is Dynamic and cannot be stored on the SQL Server. To resolve this, I...
2
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.