<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Important : Selected shapefile features using postfix Clauses (Order By). in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/important-selected-shapefile-features-using/m-p/424944#M11470</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You haven't set pFeatureClass to anything.&amp;nbsp; You have to set it to something before you can use it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Sep 2012 12:03:08 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2012-09-05T12:03:08Z</dc:date>
    <item>
      <title>Important : Selected shapefile features using postfix Clauses (Order By).</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/important-selected-shapefile-features-using/m-p/424943#M11469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to select the shapefile features using ORDER BY clause, but could not find the solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I getting the error : "Object Variable or With block variable is not SET". (at this line : Set pFeatureCursor = pFeatureClass.Search(pQueryFilter, False)).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Seeking your urgent help, if anybody knows the solutions pl help me to resolve this issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my full code :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Public Sub SelectMapFeatures()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMxDoc As IMxDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMap As IMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pActiveView As IActiveView&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pFeatureLayer As IFeatureLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pFeatureSelection As IFeatureSelection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pQueryFilter As IQueryFilter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pQueryFilterDefinition As IQueryFilterDefinition&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pQueryFilterDefinition = pQueryFilter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMxDoc = Application.Document&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMap = pMxDoc.FocusMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pActiveView = pMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'For simplicity sake let's use the first layer in the map&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; If Not TypeOf pMap.Layer(0) Is IFeatureLayer Then Exit Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pFeatureLayer = pMap.Layer(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pFeatureSelection = pFeatureLayer 'QI&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Create the query filter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pQueryFilter = New QueryFilter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pQueryFilter.SubFields = "STATE_NAME,Shape,FID"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pQueryFilter.WhereClause = "FID&amp;gt; 10"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pQueryFilterDefinition.PostfixClause = "ORDER BY STATE_NAME"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pFeatureCursor As IFeatureCursor&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pFeatureClass As IFeatureClass&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pFeatureCursor = pFeatureClass.Search(pQueryFilter, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ' Set pCursor = pQueryFilterDefinition.Search(pQueryFilter, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Invalidate only the selection cache&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Flag the original selection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Perform the selection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pFeatureSelection.SelectFeatures pQueryFilter, esriSelectionResultNew, False&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'Flag the new selection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Seeking your urgent help, if anybody knows the solutions pl help me to resolve this issue.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 06:07:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/important-selected-shapefile-features-using/m-p/424943#M11469</guid>
      <dc:creator>PawanKumar</dc:creator>
      <dc:date>2012-09-05T06:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Important : Selected shapefile features using postfix Clauses (Order By).</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/important-selected-shapefile-features-using/m-p/424944#M11470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You haven't set pFeatureClass to anything.&amp;nbsp; You have to set it to something before you can use it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 12:03:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/important-selected-shapefile-features-using/m-p/424944#M11470</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2012-09-05T12:03:08Z</dc:date>
    </item>
  </channel>
</rss>

