Select to view content in your preferred language

BA Trade Area exception on Feature class

3204
2
07-01-2013 03:49 AM
archanababu
Deactivated User
I used VBA code to add a featureclass from SDE and I tired to execute the Business Analyst Trade area tool to draw simple rings and it threw an error..

Steps to be followed:
1. Use VBA to add a featureclass from SDE
2.Click on Trade Area tool from Business analyst
3.Choose create trade area and click next
4.Choose simple rings and click next and the error appears

The VBA code I used to add layer:

Dim pWorkspaceFactory As IWorkspaceFactory
Set pWorkspaceFactory = New SdeWorkspaceFactory
Dim pPropSet As IPropertySet
Set pPropSet = New PropertySet

With pPropSet
.SetProperty "Server", server
.SetProperty "Instance", instance
.SetProperty "user", user
.SetProperty "password", password
.SetProperty "version", version
End With

Dim pWorkSpace As IFeatureWorkspace
Set pWorkSpace = pWorkspaceFactory.Open(pPropSet, 0)

Dim pClass As IFeatureClass
Set pClass = pWorkSpace.OpenFeatureClass("xyz")

Dim pLayer As IFeatureLayer
Set pLayer = New FeatureLayer
Set pLayer.FeatureClass = pClass
pLayer.Name = pClass.AliasName

Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument

pMxDoc.AddLayer pLayer
pMxDoc.ActiveView.PartialRefresh esriViewGeography, pLayer, Nothing


The error that is being displayed is :

An unhandled exception has occurred in Business Analyst. Please contact your system administrator
Index was outside the bounds of the array.
Error message stack:
Index was outside the bounds of the array.
--------------------------------------------------------------------------------
Last call:
at esriBA9.Common.DBUtilities.GetDatasetFilePath(IDataset ds)

Could anyone tell me if you have faced such issues and how to go about it...
0 Kudos
2 Replies
Jason_RobinsonRobinson
Esri Regular Contributor
I assume that the feature class being queried from SDE is a point feature.  That aside I would suggest to try using Store Setup first instead of doing directly to the Simple Ring trade area tool.  Another good test is after adding the feature to the table of contents is exporting as a shapefile/feature class to the C:\My Output Data folder and giving that a go with Simple Rings.

Regards,
Jason R.
0 Kudos
archanababu
Deactivated User
Hi Jason,

Apologies for the late response.

Yes it was a point featureclass but it does not work for polygons as well.It is not about simple rings but any tool from BA is yielding this error.I tried using the Site analysis and the error still occurrs.I do not get any error if I add a table from sde to TOC ,error occurs only for featureclasses.

The error that is being displayed is :

An unhandled exception has occurred in Business Analyst. Please contact your system administrator
Index was outside the bounds of the array.
Error message stack:
Index was outside the bounds of the array.
--------------------------------------------------------------------------------
Last call:
at esriBA9.Common.DBUtilities.GetDatasetFilePath(IDataset ds)

Please let me know your thoughts about it.
0 Kudos