I've got some code that creates a table using OLEDB connections to an access table. I want to convert this table to a Geodatabase table, so I ask a question How do I convert an access table to a proper geodatabase table? I tried to use the code there, which threw HRESULT E_FAIL, and then after reading Blah's link about using the geoprocessor I came up with this code:
Geoprocessor GP = new Geoprocessor(); ESRI.ArcGIS.ConversionTools.TableToGeodatabase tableToGeodatabaseTool = new ESRI.ArcGIS.ConversionTools.TableToGeodatabase(); tableToGeodatabaseTool.Input_Table = _cSM.Geodatabase_FilePath + "\\" + TableName; tableToGeodatabaseTool.Output_Geodatabase = _cSM.Geodatabase_FilePath; GP.Execute(tableToGeodatabaseTool, null);
... Which also throws HRESULT E_FAIL. I'm not sure why, and I'm not sure how to go about debugging it.
This code is being run from a custom toolbar in ArcGIS. It seems like ArcGIS is locking the access database, but I assume because I'm using ArcObjects that's not the problem. Any ideas?
Edit: Here are the details to the exception that is being thrown. You will note that "inner exception" is empty; it is returned as null:
System.Runtime.InteropServices.COMException was unhandled by user code Message="Error HRESULT E_FAIL has been returned from a call to a COM component." Source="ESRI.ArcGIS.Geoprocessing" ErrorCode=-2147467259 StackTrace: at ESRI.ArcGIS.Geoprocessing.GeoProcessorClass.Execute(String Name, IVariantArray ipValues, ITrackCancel pTrackCancel) at ESRI.ArcGIS.Geoprocessor.Geoprocessor.ExecuteInner(IGPProcess process, ITrackCancel trackCancel, IGeoProcessor igp, IVariantArray iva) at ESRI.ArcGIS.Geoprocessor.Geoprocessor.Execute(IGPProcess process, ITrackCancel trackCancel) at Reports.Validation.validate_StumpageValues() in C:\Users\Public\Documents\SilvAssist\Reports\Reports\Validation.cs:line 131 at Reports.frm_Options.run_Validations() in C:\Users\Public\Documents\SilvAssist\Reports\Reports\frm_Options.cs:line 160 at Reports.frm_Options.bgWorker_Validations_DoWork(Object sender, DoWorkEventArgs e) in C:\Users\Public\Documents\SilvAssist\Reports\Reports\frm_Options.cs:line 190 at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)