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...