• manipulating ADO recordsets dynamically (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » manipulating ADO recordsets dynamically (Access 2000)

    Author
    Topic
    #361668

    Is the following possible and if so how?

    Construct a ADO recordset containing one field (ID, numeric) and use this as a FILTER for another recordset. That means I want the second recordset to contain only those records with a matching record in the first recordset.

    I could modify the SQL directly but there are specific reasons that I don’t want to do that (if I can avoid doing so) in this instance. I also would rather not (for performance) loop through the first recordset and construct the second recordset as a disconnected set.

    Thanks.

    Viewing 0 reply threads
    Author
    Replies
    • #547405

      Hi Andy,
      You could use the first recordset to construct an IN clause and then filter your second recordset using that – or is that what you were trying to avoid? You could also of course create temporary tables and join them on the ID fields.

      • #547625

        Thanks Rory.
        Yes, it’s a (possibly/probably) silly idea to perform the filtering like an IN clause, just dynamically without modifying the SQL statement. This particular problem I have now sorted out with some changes to the SQL statements in the background.
        Temporary tables – I avoid them if I possibly can do because of the performance hit in creating / writing records … In instances like that I sometimes use ‘dummy’ queries and modifiy the SQL on the fly (one report being used for different sources).

    Viewing 0 reply threads
    Reply To: manipulating ADO recordsets dynamically (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: