Results 1 to 3 of 3

Thread: How to compare 2 recordsets???

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    shiraz
    Posts
    163

    Question How to compare 2 recordsets???

    Hi guys
    Well I have done the following:

    Set db=dbEngine.OpenDatabase(database)
    Set rs1 = db.OpenRecordset( SQLquery1,dbopendynaset)
    Set rs2 = db.OpenRecordset( SQLquery2,dbopendynaset)

    Now I have 2 recordsets with the same fields now I want to have rs3 as following

    Rs3= select rs1.Field1,rs1.Field2 from rs1,rs2 where rs1.Field1<> rs1.Field2

    The main idea of this query is to obtain records in rs1 which does not exist in rs2. now my problem is that I don’t know how to use a SQL query for 2 different recordsets that I have created while runtime can anybody help?
    Thank u

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    shiraz
    Posts
    163

    Re: How to compare 2 recordsets???

    sorry guys i meant:
    Rs3= select rs1.Field1,rs1.Field2 from rs1,rs2 where rs1.Field1<> rs2.Field1

  3. #3
    Lively Member
    Join Date
    Jan 2002
    Location
    Posts
    114

    Red face

    What scenario U R talking about why do u need Two recordsets for one table.....

    why dont u use where condition in first record set and after adding those records in the grid then close the recordset and open again record set with different condition then their will be no need to open two recordsets....

    for instance if u compare rs1.fields1 <> rs2.fields1 then there will be, in one case duplication of records at selection or no records selected....

    if this is not the problem u r facing then please explain clearly

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width