Hi all
Quick question to see if it can be done. When using acces it is possible to build a query and then use this query in the query builder when creating a second query.
What i want to know is that if it is possible to write a sql query as a string in VB but use a recordset which is populated in code to join on.
i.e.
This is an example in access
i'd like a similar sort of thing using a recordset and have tried something like this to no avail.
where rsChildDischarges is a recordset.
Any help on this matter would be most appreciated.
Thanks in advance.
Quick question to see if it can be done. When using acces it is possible to build a query and then use this query in the query builder when creating a second query.
What i want to know is that if it is possible to write a sql query as a string in VB but use a recordset which is populated in code to join on.
i.e.
This is an example in access
Code:
SELECT CONTACTS.*
FROM CONTACTS INNER JOIN [chdis 1] ON CONTACTS.PATIENT_NO = [chdis 1].PATIENT_NO;
i'd like a similar sort of thing using a recordset and have tried something like this to no avail.
Code:
SELECT CONTACTS.* FROM CONTACTS INNER JOIN [" & rsChildDischarges & "] ON CONTACTS.PATIENT_NO = [" & rsChildDischarges & "].PATIENT_NO
where rsChildDischarges is a recordset.
Any help on this matter would be most appreciated.
Thanks in advance.