AnsweredAssumed Answered

Error 0x80041538 in IWorkspaceFactory.Open

Question asked by lubrodi on May 16, 2012
Latest reply on May 16, 2012 by lubrodi
Hello everyone!
I created a connection in ArcCatalog (version 10) to access a spatial database remotely through a VPN. ArcCatalog connects to the database SUCCESSFULLY.
Below are the properties of the connection:
Server: <empty> Service: sde:Oracle11g:/;LOCAL=ORADEV Database: <empty> [X] Database connection Username: theUser Password: thePass [X] Save username and password. Version: sde.DEFAULT [X] Save the transactional version file name with the connection.

But when using the same settings to connect to the database via a C# program, throws an COMException with the code 0x80041538 and error description "Underlying DBMS error [Unknown errorNo extended error.]".
I tried using the file (.sde), created by ArcCatalog (and successfully connection), but the program causes the same exception.
Below is the source in C#.
Can anyone help me?
Thank you very much!
-- Luciano.

using System; using System.Collections.Generic; using System.Linq; using System.Text; using ESRI.ArcGIS.Geodatabase; using ESRI.ArcGIS.esriSystem; using ESRI.ArcGIS.DataSourcesGDB; using ESRI.ArcGIS.DataManagementTools; using ESRI.ArcGIS.Geometry; using ESRI.ArcGIS.GeoDatabaseDistributed; using ESRI.ArcGIS; using ESRI.ArcGIS.TrackingAnalyst; using ESRI.ArcGIS.Server;  namespace testearc_sharp  {     class Program      {         [STAThread()]         static void Main(string[] args)    {             IAoInitialize a = new AoInitialize();             RuntimeManager.Bind(ProductCode.Engine);             try             {                 IWorkspace ws = null;                 IPropertySet pPropSet = new PropertySetClass();                 IWorkspaceFactory pSdeFact = new SdeWorkspaceFactoryClass();                 /*                  * Another way, using de .sde from ArcCatalog. Same error.                  *                                    pPropSet = pSdeFact.ReadConnectionPropertiesFromFile("D:/Users/ArcGISSOM/AppData/Roaming/ESRI/Desktop10.0/ArcCatalog/ORADEV.sde");                                    */                 pPropSet.SetProperty("INSTANCE",    @"sde:oracle11g:/;LOCAL=ORADEV");                 pPropSet.SetProperty("USER",        "theUser");                 pPropSet.SetProperty("PASSWORD",    "thePass");                 pPropSet.SetProperty("VERSION",     "sde.DEFAULT");                 pPropSet.SetProperty("AUTHENTICATION_MODE", "DBMS");                  ws = pSdeFact.Open(pPropSet, 0); // ### COMException ERROR ###             }             catch (Exception ex)             {                 Console.WriteLine("exception occurred");                 Console.WriteLine(ex.Message);                 Console.WriteLine(ex.StackTrace);             }             Console.WriteLine("finished, press key");             Console.ReadKey();             a.Shutdown();         }     } }