Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

is it possible to use recordset in Where clause of Select query

I wrote one common query which will be run on Access,SQl and oracle.now i want to write the subquery in where clause which contains some id which i want to add in where clause.This id has been stored in .txt file.
i made one recordset from that text file.i want to use that recordset in subuquqry. i have written that query using VB.6.0 and ADO object.
is it possible to use recordset in where clause of select query.
or is there any other way to include text file's data in subquery of select query.


thanks in advance

regards.


Comments

  • GideonOmegaGideonOmega Member Posts: 617
    : I wrote one common query which will be run on Access,SQl and oracle.now i want to write the subquery in where clause which contains some id which i want to add in where clause.This id has been stored in .txt file.
    : i made one recordset from that text file.i want to use that recordset in subuquqry. i have written that query using VB.6.0 and ADO object.
    : is it possible to use recordset in where clause of select query.
    : or is there any other way to include text file's data in subquery of select query.
    :
    :
    : thanks in advance
    :
    : regards.
    :
    :
    :
    if you have an rs set up with the values from the text file and you are on the record that you want to use you can concatenate the value from the rs into the query like so: (lets say your text file rs is called TextRS)

    [code]
    with otherRS
    .activeconnection = ConnectionObject
    .cursorlocation = adUseClient
    .cursortype = adOpenForwardOnly
    .source = "Select * From YourTable where fldID = " & TextRS!fldID
    .open
    ........
    [/code]
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

Sign In or Register to comment.