Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Pulling a subset from a recordset


Reply
 
Thread Tools Display Modes
  #1  
Old 06-11-2003, 10:56 AM
Hoplite's Avatar
Hoplite Hoplite is offline
Regular
 
Join Date: Feb 2003
Location: Cleveland
Posts: 83
Default Pulling a subset from a recordset


Hello,

I was curious if anyone knew of a way to query an ADO recordset.

I have a disconnected ADO recordset that my program works with. I would like to run a SQL query against that recordset and populate the results into another recordset.

This is entirely in VB. I want to avoid using temp tables in our DB. Can it be done?
__________________
"May the forces of evil become confused on the way to your house!!"
Reply With Quote
  #2  
Old 06-11-2003, 11:45 AM
Akim Akim is offline
Regular
 
Join Date: May 2003
Location: New York
Posts: 104
Default

You can use Filter property on your existing recordset, if that's what you need.
Reply With Quote
  #3  
Old 06-11-2003, 12:21 PM
Hoplite's Avatar
Hoplite Hoplite is offline
Regular
 
Join Date: Feb 2003
Location: Cleveland
Posts: 83
Default

I can do a lot of what I need with .Filter and .Sort, but is there a way to pull out some of the aggregate functions (Sum(), Max(), etc.). It seems to me there should be a better way than looping through the entire recordset tallying or comparing values.
__________________
"May the forces of evil become confused on the way to your house!!"
Reply With Quote
  #4  
Old 06-11-2003, 12:51 PM
Akim Akim is offline
Regular
 
Join Date: May 2003
Location: New York
Posts: 104
Default

You can't execute SQL against your existing disconnected recordset. The only thing you can do is to re-query your database and run your aggregate functions against your database (obviously, SQL statements executed on the database side).
Or you can loop through your recordset to achieve the same result.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
can you put a record from recordset A into recordset B Knoxville Database and Reporting 2 05-02-2003 01:40 AM
Recordset Update - Related Records Problem punkrawk Database and Reporting 6 02-24-2003 02:22 PM
need help making my own recordset (Not pulling from DB but from another recordset) Magnus_Dx Database and Reporting 2 01-10-2003 02:57 PM
Recordset Bug: Phantom Records chomp Database and Reporting 4 08-01-2002 04:19 PM
One recordset can be updated but the other can't Mumble Database and Reporting 1 02-13-2001 11:28 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->