The code I am writing for a button (ArcObjects 9.2, Visual Studio 2005) takes the attributes for selected points in a shapefile and writes them to a table:

Dim pGp As GeoProcessor = New GeoProcessor
pGp.OverwriteOutput = True
Dim pParams As IVariantArray = New VarArrayClass
Dim strFolderName As String = "C:\temp"
Dim strTableName As String = "TandE_data2.dbf"
With pParams
    .Add(pTELayer) 'A point SHP with at least one feature selected
    .Add(strFolderName) '("in_memory")
    .Add(strTableName) '("TandE_data2")
End With
pGp.Execute("TableToTable_conversion", pParams, Nothing)

As written, the process will fail at the pGp.Execute statement on the third execution, with the message

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in SDtools.dll

appearing in Visual Studio's output window. If the output is directed to an in_memory workspace table instead of a DBF (using the values seen in the code comments), the code always runs to completion.

What changes do I need to make to the code for it to output to a DBF consistantly?

1 Answer 1


I discovered that using TableToDBASE instead of TableToTable doesn't cause the same error. I had to jump through a couple of extra hoops to get the table named right, but now I can run the code at least 10 times without getting an error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.