 |
| Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

February 19th, 2004, 07:16 PM
|
|
Authorized User
|
|
Join Date: Feb 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ADO Record Set Question
Can I, using only ADO, retrive two different recordsets and then perform a SQL query on them (lets say an outer join) to form a third?
Dave
__________________
Dave
|
|

February 20th, 2004, 04:55 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Nope, you can't connect them. There is no such thing as linking the two recordsets by creating a relationship or something like that.
What exactly are you trying to accomplish? There may be other ways to do this. For instance, get the required data directly from the server (faster, with less overhead).
Alternatively, you could write some code that does lookups on the Recordsets, and creates a new one on the fly. However, that's not going to perform nor scale pretty well.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

February 20th, 2004, 10:35 AM
|
|
Authorized User
|
|
Join Date: Feb 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
My firm's job related financials are available on an ODBC connection. I have read only access to the server so I am pretty much limited to select queries off the data. For bizarre reasons, only known to the accounting trolls, there are from zero (no records) to two adjustments (two records) per job number each month in one little table, all other summary tables have a single summary entry per job number. So I have queries with a bunch of inner joins, but need and outer join to the last table and that has to include a SUM on the adjustments. Experimentation has shown me that I have to query it separately and then row process in the adjustments.
I guess I can always invoke DAO and drop them into a local, temporary database and then query them together, or I can keep on doing it in memory if the number of rows is small enough.
Dave
Dave
|
|

February 20th, 2004, 11:15 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
If you're talking about a fe records in one of the recordsets, you could the Filter property of the large recordset. Filter it based on the stuff you get from the small recordset. It may not perform very fast, but it may be easy to code and use.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

February 20th, 2004, 12:21 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I would say that you should be asking a question in one of the SQL groups. I have worked at companies that have all their business logic in SQL. Although I don't like this, I would expect that you could solve your entire problem in SQL. If need be you may be able to create a temp table, or a table variable (MS-SQL 2000 or above).
John R Lick
[email protected]
|
|
 |