Description

This method allows an open McDBDatabase object to become attached to (i.e. queried by) this McDBQuery, when executed.

Return Type

None  

Syntax

object.AttachDatabase ToSearch

The AttachDatabase Method syntax has these parts:

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

A pointer to the McDBDatabase to add to the databases queried.

Remarks

This method may be used as an alternative to CMcDBDatabase.CreateQuery() to set an initial Query database. Further, an McDBDatabase is only attached to a query once. Calling this method with a database that has already been attached will have no effect (S_FALSE is returned). McDBDatabase instances must also be open prior to calling this method, otherwise it will return E_INVALIDARG.

Exceptions

Error Value Description
E_INVALIDARG &H80070057 The McDBDatabase ToSearch is not Open
E_FAIL &H80004005 The McDBQuery specification has already been started (i.e. one or more calls to Set<...> have been made). It is no longer valid to add additional McDBDatabase instances to the query scope.