Error using esriSpatialRelOverlaps

3941
4
06-23-2011 07:26 AM
HenkZwols
Occasional Contributor
Hello all,

The VBA code below gives me this error:
A subscription cannot be stored unless its event class already exists

This happens only when using esriSpatialRelOverlaps.
Set pFeatureLayer = pLayer
pSpatialFilter.SpatialRel = esriSpatialRelOverlaps
Set pSpatialFilter.geometry = pInFeature.ShapeCopy
Set pFeatureCursor = pFeatureLayer.FeatureClass.Search(pSpatialFilter, False)
Set pFeature = pFeatureCursor.NextFeature



Can somebody tell me what's going on? I think it has something to do with the migration to ArcGis10.

Greetings, Henk
0 Kudos
4 Replies
ChaoWang
Esri Contributor
Hi Henk,

I tried the code with some testing data and I don't see any errors. I wonder have you tried the code with any other dataset? Can you see consistent behavior?

Thanks,
Chelsea
0 Kudos
HenkZwols
Occasional Contributor
Hi Henk,

I tried the code with some testing data and I don't see any errors. I wonder have you tried the code with any other dataset? Can you see consistent behavior?

Thanks,
Chelsea


I think you are right. Processing data in another sde version gives no problem. Any idea what causes the error?

Thanks
0 Kudos
ChaoWang
Esri Contributor
I would assume you have whereclause for the pSpatialFilter?

- Could you please double check the fields and the domain to make sure there's nothing wrong with the data?
- What if we change the query here, are you still getting errors?
0 Kudos
HenkZwols
Occasional Contributor
Yes, there is a whereclause involved. But this can't be the problem, because it's working in a different sde-version where the datastructure is the same.

I can't reproduce the error anymore. Someone must have fixed the data.

Thanks
0 Kudos