English

Problem: Cannot query on a joined feature if the feature class and joined table are in different locations in an MSD based map service

Description

MSD based services with joined datasets fail to perform Query in Services Directory if the feature class and table are stored in different locations. For example, a feature class from SDE joined with a table from SQL server cannot be queried.

Cause

In MSD based map services, when a feature class and a joined table are stored in different locations, users cannot query the feature.

Solution or Workaround

The instruction provided below describe a work around for this problem.

Place the table and feature class in the same location, such as an SDE database. Join the table with the feature class and save it as MXD and MSD. Publish these files.

  1. Start ArcMap.
  2. Open Visual Basic Editor.

    In ArcMap, select Tools > Macros > Visual Basic Editor.

  3. Create a new UIToolControl.

    A. Select Tools > Customize to open the Customize dialog box.
    B. Click the Commands tab.
    C. Select UIControls from the Categories list box.
    D. Select Untitled from the Save In dropdown list to save the tool to this map document. Select Normal to save the tool to all ArcMap documents on your machine.
    E. Click New UIControl.
    F. Select UIToolControl and Create.
    G. Drag the new UIToolControl to the toolbar of your choice.
    H. Close the Customize dialog box.



    Note:
    For more information on creating a UIControl, see the ArcGIS Desktop Help topic Creating custom commands with VBA and UI Controls.

  4. Right-click the UIToolControl and select View Source.
  5. Copy this code into the UIToolControl's mousedown event.