Select to view content in your preferred language

Excel to ITable in arcgis soe 10.2.2

4432
6
01-28-2015 02:04 AM
mohannainar2
Deactivated User

I am trying to convert excel to ITable in ArcGIS (10.2.2) SOE. I am using the below code for converting.

  

Type factoryType = Type.GetTypeFromProgID( "esriDataSourcesOleDB.ExcelWorkspaceFactory");  

IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);

IWorkspace workspace = workspaceFactory.OpenFromFile(@"E:\apps\DevelopmentArea\test.xls", 0);

IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspace;

ITable table = featureWorkspace.OpenTable("Sheet1$");

 

I am getting the error in OpenfromFile method , arcgis server and the SOE projects are in same system.

Error message : Exception from HRESULT: 0x80040213

 

I checked in the net i could find any help. Kindly provide your suggestion

Tags (1)
0 Kudos
6 Replies
nicogis
MVP Frequent Contributor

Has the user 'arcgis' privileges ntfs open file test.xls ?

0 Kudos
mohannainar2
Deactivated User

I checked the ' folder security' Everyone is having full access . I am not sure how to set it for 'arcgis' user , can you tell me how to do that.

The same code I wrote in console application it worked for me , the only problem I am facing in ArcGIS soe . In console application I added the below three lines of code.    

        RuntimeManager.Bind(ProductCode.Desktop);
ESRI.ArcGIS.esriSystem.IAoInitialize     ao = new ESRI.ArcGIS.esriSystem.AoInitialize();
ao.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeStandard);
I tried adding the above three lines in ArcGIS soe but no use it did not worked.
     

   
0 Kudos
nicogis
MVP Frequent Contributor

the user that impersonation arcgis server 'soe' (see ArcGIS for Server Installation Guide - The ArcGIS Server account ) is arcgis server account.

if you use code in console you are using the current user.

0 Kudos
mohannainar2
Deactivated User

Thanks for the information .

I identified the arcgis user and gave the full permission , still i am facing same error mrssage.

0 Kudos
nicogis
MVP Frequent Contributor

The following data types are unsupported in 64-bit processing:

0 Kudos
mohannainar2
Deactivated User

Thanks for the information.

0 Kudos