Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-05-31 : 09:10:13
|
| Bryan writes "Is it possible to Set a Recordset = to Select from another Recordset?It should look something like this in VBRecordset1 = "Select Count(*) from" & Recordset2 & "Where parameters are met"" |
|
|
M.E.
Aged Yak Warrior
539 Posts |
Posted - 2002-05-31 : 10:24:38
|
| To my knowledge no... Would it not be easier just to select that second recordset from the table as well?recordset1 = "Select * from table where a = 1"recordset2 = "select * from table where a = 1 and b = 2"Edited by - M.E. on 05/31/2002 10:28:03 |
 |
|
|
MakeYourDaddyProud
184 Posts |
Posted - 2002-05-31 : 10:33:56
|
| Not sure what your exact requirements are but if you are using ADO, there is a Clone method, try this:If objRecordset.Supports(adBookmark) = True Then Set objRecordsetClone = objRecordset.Clone(adLockReadOnly)End IfAlthough, this actually creates a duplicate (pointer) recordset. Not actually a copy.Daniel Small CEOwww.danielsmall.com |
 |
|
|
bcollinson
Starting Member
9 Posts |
Posted - 2002-05-31 : 10:53:21
|
| take a look at the filter method of the recordset object - this may do something similar to what you're after. |
 |
|
|
macka
Posting Yak Master
162 Posts |
Posted - 2002-05-31 : 11:01:11
|
| Do you mean something like this:SELECT COUNT(*)FROM ( SELECT SomeField FROM SomeOtherTable WHERE SomeOtherField = 1 ) SomeDerivedTableWHERE SomeDerivedTable.SomeField = 2macka.Edited by - macka on 05/31/2002 11:03:20 |
 |
|
|
|
|
|