Wrox Programmer Forums
|
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
 
Old February 19th, 2004, 07:16 PM
Authorized User
 
Join Date: Feb 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
 
Old February 20th, 2004, 04:55 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old February 20th, 2004, 10:35 AM
Authorized User
 
Join Date: Feb 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old February 20th, 2004, 11:15 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old February 20th, 2004, 12:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jlick
Default

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
JohnRLick@hotmail.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
last record with ado.net CyberW ASP.NET 3.5 Basics 5 November 6th, 2008 04:39 PM
ADO Record Locking pjohanne VB Databases Basics 3 March 9th, 2006 05:42 AM
ADO record copy and add to table Freddyfred Access 2 February 16th, 2005 10:36 PM
How to detect the record modified (ado) jolzy Pro VB Databases 3 October 28th, 2004 02:18 PM
Returning record in stored function with ADO nmbarbillo Oracle 0 June 15th, 2004 12:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.