CreateDataLinkForQuery(query)
Returns the DataLink object that represents a descriptor of a link between the feature type and a cataloged query of external database. The query argument specifies a cataloged query to be linked (object Query). The feature type should not belong to a work layer of the theme because the feature types of work layers cannot be linked with tables from GDB or external databases. To link a query with the feature type, set up the DataLink object and add it to the FeatureType::DataLinks collection. For details on setting up a link descriptor, see the chapter "DataLink Object".