Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

JoinField in geoprocessor giving errors

$
0
0
HI,

I am in Arc10.0 using VB.net. trying to use the GP tool JoinField as shown below, but it keeps giving "Runtime.InteropServices.COMException (0x80004005)" ERRORS. I have used other GP tools just fine. FYI, below I have also tried adding the tables as objects and without the .dbf extension with no luck.

Public Function Test_GP2()

' Create geoprocessor. Overwrite true will replace existing output.

Dim pJoin As ESRI.ArcGIS.DataManagementTools.JoinField
Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult

Try

' Execute the tool

pJoin = New ESRI.ArcGIS.DataManagementTools.JoinField
pJoin.in_data = "C:\_Debbie\GapTool\Results\2\3S_3\Output\3S_3\E_3S_3.dbf"
pJoin.in_field = "VALUE"
pJoin.join_table = "V:\Natural_Resources\LandCover2000\LV2000\LV2000.dbf"
pJoin.join_field = "UNIQUE_ID"

Result = RunTool(pJoin, Nothing)


Catch ex As Exception
MsgBox("ERROR: " & m_Current_Address & " - Export table - " & " " & ex.Message)

Finally
pJoin = Nothing
Result = Nothing
End Try

End Function

Public Function RunTool(ByVal Process As ESRI.ArcGIS.Geoprocessor.IGPProcess, ByVal TC As ESRI.ArcGIS.esriSystem.ITrackCancel) As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult

Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult
Dim GP As ESRI.ArcGIS.Geoprocessor.Geoprocessor = New ESRI.ArcGIS.Geoprocessor.Geoprocessor()
Try

Result = CType(GP.Execute(Process, Nothing), ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult)
If Result.Status <> ESRI.ArcGIS.esriSystem.esriJobStatus.esriJobSucceeded Then MsgBox("error") 'ReturnMessages()
GP.ClearMessages()
Catch ex As Exception

System.Windows.Forms.MessageBox.Show(ex.ToString, "Run Geoprocessor")
End Try

Return Result

End Function

thanks,

Viewing all articles
Browse latest Browse all 1374

Trending Articles