Description

This method allows this (uninitialized) CMcDBQuery to set its (McDBDatabase) scope from an existing McDBQuery object, allowing simple/more flexible creation of subquery McDBQuery objects.

Return Type

None  

Syntax

object.AttachToQuery QueryScope

The AttachToQuery Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McDBQuery.
QueryScopeRequired. A McDBQuery object.

A pointer to the already initialized McDBQuery object to match the scope of this McDBQuery to.

Remarks

This method may be used as an alternative to the McDBDatabase.CreateQuery and McDBQuery.AttachDatabase methods to set an McDBDatabase scope. That is, establish which McDBDatabase instance(s) will be queried by this McDBQuery, \ when executed.

Exceptions

E_PENDING       &H8000000A  This McDBQuery has already had a specification started
                            (i.e. one or more of its Set<...> methods have already
                            been called).
E_INVALIDARG    &H80070057  QueryScope does not have a query scope set (i.e. it is not
                            associated with any McDBDatabase instance(s) to query, yet)