How? One recordset, second query

How? One recordset, second query

Post by Beatnik » Wed, 12 Apr 2000 04:00:00



How can a recordset be subjected to second query, with different fields?

A query runs on a table resulting in a record set (rs) which is displayed to
the user.
The user then chooses from that display, resulting in the recordset being
queried for a second time.

Thank You,

John Bigalke
Beatnik's

 
 
 

How? One recordset, second query

Post by Paul S. Gann » Thu, 13 Apr 2000 04:00:00



>How can a recordset be subjected to second query, with different fields?

>A query runs on a table resulting in a record set (rs) which is displayed to
>the user.
>The user then chooses from that display, resulting in the recordset being
>queried for a second time.

Two suggestions:
1. Use a second recordset on the same data source, then optimise the
two in terms of variables for what you want to do.
2. Don't use parameterised queries, but explicitly set the m_strFilter
variable.

HTH

Paul.
-------------------------------------------
Expressed opinions are usually my own.
Especially if they're any good (of course).
-------------------------------------------

 
 
 

How? One recordset, second query

Post by Beatnik » Thu, 13 Apr 2000 04:00:00


Thank You SO much!!!

Is anything like this possible??
    m_TestDaoRecordset.m_strFilter = ("[CatID] =5"&&"[Page]=4");
    // (This doesn't work in it's present state)

Or do I need to try something like this?

    m_TestDaoRecordset.m_strFilter = "[CatID] =5";
    m_TestDaoRecordset.open();

    m_TestDaoRecordset2=m_TestDaoRecordset

    m_TestDaoRecordset2.m_strFilter = "[Page] =4";
    m_TestDaoRecordset.open();

Thank You,
John Bigalke

 
 
 

How? One recordset, second query

Post by Paul S. Gann » Fri, 14 Apr 2000 04:00:00



>Thank You SO much!!!

>Is anything like this possible??
>    m_TestDaoRecordset.m_strFilter = ("[CatID] =5"&&"[Page]=4");
>    // (This doesn't work in it's present state)

m_strFilter is a CString, so it needs text. "[CatID] =5"&&"[Page]=4"
is attempting to produce a logical. Use "[CatID]=5 and [Page]=4", ie a
normal SQL WHERE clause.

HTH

Paul.
-------------------------------------------
Expressed opinions are usually my own.
Especially if they're any good (of course).
-------------------------------------------

 
 
 

1. DAO - Query working on one computer but not on the second

Hello!

I have a query that works perfectly on my computer but not at all on
the users! On my computer I get all LID's in meQuery and if there is a
X in ALTPOS1 I also will get this. On the users computer we don't get
any values

This is the query:

SELECT meQuery.LID, ALTPOS1.X FROM meQuery LEFT OUTER JOIN ALTPOS1 ON
(meQuery.LID=ALTPOS1.LID AND ALTPOS1.FID=9);

If I remove the second part of the ON condition, altpos1.fid=9, then I
get values.

The only difference I can figure out between the computers are that I
only have Access97 installed and the user has both Access97 and
Access2000.

The query is runned through DAO (via VC++)

Any suggestions??

// Anders

2. sum a numeric field based on a condition

3. how to set recordset clone to second child level recordset in shape command

4. New knowledgebase site - looking for authors, articles or tips about databases.

5. Updating RecordSet with values of a second RecordSet

6. Enterprise Manager locks up when trying to import file

7. query different connections with one recordset

8. two queries into one recordset

9. Assigning multiple queries to one recordset

10. How to Show Results from Multiple Recordsets in One ASP Without Slowing by Mulitple Queries

11. How to compare two single column recordsets in one query

12. query different connections with one recordset