J
Joanne
Hello, I have a main data source with a query field with two tables in it,
both with a "LoginID" field. I populate the first table's field with a name,
e.g. JSMITH. The field name is @loginID. Then I want the query to select
only those fields in the second table which have the same name in the
@loginID field, but I keep getting an error.
Here is the code:
'Get the original query
strOrigSQLCommand=XDocument.QueryAdapter.Command
set
queryMentor=XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:tblMentor_Lookup")
QueryMentor.SelectSingleNode("@MentorLoginID").text=strinfo
strSQLQuery=XDocument.QueryAdapter.BuildSQLFromXMLNodes(QueryMentor)
'Concatenate WHERE clause and original SQL statement
IT IT ON THE NEXT LINE THAT THE CODE FAILS (in the where clause,but if I
only use one table it works fine).
strSQLQuery= strOrigSQLCommand + " WHERE " + strSQLQuery
XDocument.QueryAdapter.Command=StrSQLQuery
XDocument.Query()
both with a "LoginID" field. I populate the first table's field with a name,
e.g. JSMITH. The field name is @loginID. Then I want the query to select
only those fields in the second table which have the same name in the
@loginID field, but I keep getting an error.
Here is the code:
'Get the original query
strOrigSQLCommand=XDocument.QueryAdapter.Command
set
queryMentor=XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:tblMentor_Lookup")
QueryMentor.SelectSingleNode("@MentorLoginID").text=strinfo
strSQLQuery=XDocument.QueryAdapter.BuildSQLFromXMLNodes(QueryMentor)
'Concatenate WHERE clause and original SQL statement
IT IT ON THE NEXT LINE THAT THE CODE FAILS (in the where clause,but if I
only use one table it works fine).
strSQLQuery= strOrigSQLCommand + " WHERE " + strSQLQuery
XDocument.QueryAdapter.Command=StrSQLQuery
XDocument.Query()