Table export with postfix clause failing with FGDB in 10.1 SP1

3169
3
01-09-2013 08:26 AM
MikeDuppong
New Contributor
Hello,

Anyone else having an issue with exporting data from a table in a file geodatabase using an IQueryFilterDefinition postfix clause in ArcGIS Desktop 10.1?

Essentially:

IQueryFilter queryFilter = new QueryFilterClass();
queryFilter.WhereClause = "InspDate >= CURRENT_DATE - 365";
queryFilter.SubFields = "*";
IQueryFilterDefinition queryFilterDef = (IQueryFilterDefinition)queryFilter;
queryFilterDef.PostfixClause = "order by SiteID asc, InspDate desc";
ICursor cursor = table.Search(queryFilter, false);
IExportOperation exporter = new ExportOperationClass();
exporter.ExportTable(datasetName, queryFilter, cursor as ISelectionSet, outputName, 0);


This works in 10.0.  In 10.1 it results in an exception:

"Error: The owner SID on a per-user subscription doesn't exist (Exception from HRESULT: 0x80040207)"

With the proper change of the query filter's WhereClause to "InspDate >= DATEADD(day, -365, GETDATE())", this same code works on both 10.0 and 10.1 systems using SDE.  So, only file geodatabases in 10.1 seem to be giving the problem.

Any ideas?
0 Kudos
3 Replies
DerekRyter
New Contributor II
I just had the exact same thing happen. Really simple code. Worked with layer tied to PGDB. I remapped it to a FGDB and I get the same error on the line that calls the RowCount method. What is going on?!!! It's not a Arc error, I don't think, it looks like a Microsoft error.

   Private Function CountBCs(ByVal lcBC As String, ByVal pLayer As IFeatureLayer) As Long
        Try

            Dim pBCTable As ITable = pLayer
            Dim pQF As IQueryFilter = New QueryFilter
            Dim lnDRNcount As Long = 0
            Dim lcUpper As String = lcBC.ToUpper
            Dim lcLower As String = lcBC.ToLower

            For lnLayer As Long = 1 To txtLayers.Text

                pQF.WhereClause = "[BC_" & lnLayer & "] = '" & lcUpper & "' OR [BC_" & lnLayer & "] = '" & lcLower & "'"
                lnDRNcount += pBCTable.RowCount(pQF)

            Next

            Return lnDRNcount

        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, "CountBCs")
        End Try

    End Function
0 Kudos
DerekRyter
New Contributor II
It must be the sql syntax is different for different GDBs. I removed the brackets and it worked.
0 Kudos
LanceShipman
Esri Regular Contributor
"[]" are unique to Access and SQL Server. They are not part of the SQL standard.
0 Kudos