ArcGIS Server: connection to SDE Oracle

Source: Internet
Author: User
• Top print reply alert moderator
Subject Connection to SDE Oracle
Author Mourad abusall
Date Jun 25,200 7
Message I created this code to connect on GeoDatabase SDE and this Code not working I don't know why !!.

What I do for this?
Please help me ....
It was stoped on this code:
------------------------
Pfact = new sdeworkspacefactory
Pworkspace = pfact. Open (ppropset, me. hwnd)
------------------------
And display this error:
"Page_error
Exception from hresult: 0x80040228"

 
Dim pPropSet As IPropertySet            pPropSet = New ESRI.ArcGIS.esriSystem.PropertySet            Dim pFact As IWorkspaceFactory            Dim pWorkspace As ESRI.ArcGIS.Geodatabase.IWorkspace            With pPropSet            .SetProperty("Server", "isc-devsrv")            .SetProperty("Instance", "5151")            .SetProperty("Database", "")            .SetProperty("User", "REGIS")            .SetProperty("password", "REGIS")            .SetProperty("version", "SDE.DEFAULT")            End With            pFact = New ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactory            pWorkspace = pFact.Open(pPropSet, Me.HWnd)            Dim pFeatureWorkspace As IFeatureWorkspace            pFeatureWorkspace = pWorkspace            Dim pFeatureClass As IFeatureClass            pFeatureClass = pFeatureWorkspace.OpenFeatureClass("REIS_SDE.RPAR_Real_Estate_Parcels")            Dim dsenum As IEnumDataset = pWorkspace.getDatasets(ESRI.ArcGIS.Geodatabase.esriDatasetType.esriDTFeatureDataset)            Dim ds As IDataset = dsenum.Next()            While Not (ds Is Nothing)            MsgBox(ds.Name)            ds = dsenum.Next()            End While            

  Mourad abusall
GIS developer

Ideal solutions Co.

Ahmed bin Ali Str., Wadi Al sail west
PO Box 20851, Doha, Qatar
Tel: + 974-4888450/2/3
Fax: + 974-4888451
Mob: + 974-5028350
Email: mabusall@isolc.com
Web: www.isolc.com

   
• Top print reply alert moderator
Subject Re: connection to SDE Oracle
Author Jeff bourdier
Date Jul 11,200 7
Message I am having almost this same exact problem. (the only difference is that my error message doesn't say "page_error ".)

What version of ArcGIS are you using? I'm using 9.2.

The 9.2 documentation on iworkspacefactory. open says to specify an additional property, "authentication_mode" as either "OSA" or "DBMS ". I have specified it as "DBMS" and still get the same error.

Any help on this wocould be appreciated!

 
Dim pPropSet As IPropertySet            Dim pSdeFact As IWorkspaceFactory            pPropSet = New PropertySet            With pPropSet            .SetProperty("SERVER", Server)            .SetProperty("INSTANCE", Instance)            .SetProperty("DATABASE", Database)            .SetProperty("USER", User)            .SetProperty("PASSWORD", Password)            .SetProperty("AUTHENTICATION_MODE", "DBMS")            .SetProperty("VERSION", version)            End With            Dim pSDEWorkspace As IWorkspace            pSdeFact = New SdeWorkspaceFactory            pSDEWorkspace = pSdeFact.Open(pPropSet, 0)            

   
• Top print reply alert moderator
Subject Re: connection to SDE Oracle
Author Jim wozniczka
Date Jul 12,200 7
Message I am having the exact same problem with 9.2, so you're not alone!
   
• Top print reply alert moderator
Subject Re: connection to SDE Oracle
Author Matt McGuire
Date Jul 12,200 7
Message I am getting the same error and I'm guessing it is because hwnd is a Windows Programming construct. I don't think the Web server can deal with it.

If that is true, it leaves us the question-how do I connect directly to an SDE database with DOTNET and ArcObjects? Can it be done?

   
• Top print reply alert moderator
Subject Re: connection to SDE Oracle
Author Jim wozniczka
Date Jul 16,200 7
Message FYI... I 've got an incident open with ESRI technical support about this problem. I'll be sure to post if I get a response of some kind.

Jim

   
• Top print reply alert moderator
Subject Re: connection to SDE Oracle
Author Andrew Hayden
Date Jul 16,200 7
Message Here is some code I cobbled together when I was working on examples of dynamically adding shapefiles and featureclasses (from a button click event ). some of it's commented and some is double commented (there is a shapefile example and my adaptation for an SDE example (vector and raster )). you shoshould pretty much get the idea of what you need to uncomment to get it to work. the code works with SDE oracle.
 
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click            '********************************************************************************************************            'Code for connecting to shapefiles on the server or connecting to SDE            'Dim mapFunc As ESRI.ArcGIS.ADF.Web.DataSources.IMS.MapFunctionality = _            'CType(Map1.GetFunctionality(0), ESRI.ArcGIS.ADF.Web.DataSources.IMS.MapFunctionality)            'Dim mapView As MapView = mapFunc.MapView            ''shapefile example            ''Dim drainWkspc As New ShapeWorkspace("riversWorkspace", "D:\ArcIMS\data\NorthAmerica")            ''sde example            ''Dim drainWkspc As New SdeWorkspace("riversWorkspace", "servername", "port:XXXX", "user", "password")            ''sde raster example            'Dim drainWkspc As New SdeWorkspace("riversWorkspace", "servername", "port:XXXX", "user", "password")            ''shapefile example            ''Dim drainDataset As New FeatureDataset("Rivers", drainWkspc)            ''sde example            ''Dim drainDataset As New FeatureDataset("LAND.TFLANDS", drainWkspc)            ''sde raster example            'Dim drainDataset As New ImageDataset("SDE_RASTER.CIR2005.RASTER", drainWkspc)            ''shapefile and sde example            ''Dim drainLayer As New ESRI.ArcGIS.ADF.IMS.Carto.Layer.FeatureLayer("riversDynamic", drainDataset)            ''drainLayer.Type = FeatureType.Polygon            ''sde raster example            'Dim drainLayer As New ESRI.ArcGIS.ADF.IMS.Carto.Layer.ImageLayer(drainDataset)            ''shapefile and sde example            ''Dim drainSymbol As New SimpleLineSymbol(System.Drawing.Color.Blue, 2)            ''Dim drainRenderer As New SimpleRenderer(drainSymbol)            ''drainLayer.Renderer = drainRenderer            ''drainLayer.Name = "TF Lands"            ''sde raster example            'drainLayer.Name = "2005 Color IR"            '' ArcIMS map configuration file (axl) needs 'MAP dynamic="true"' to work            'mapView.Layers.Add(drainLayer)            'Map1.InitializeFunctionalities()            'Map1.Refresh()            'Toc1.Refresh()

   
• Top print reply alert moderator
Subject Re: connection to SDE Oracle
Author Knut Erik holund
Date Jul 19,200 7
Message Your code Andrew Hayden, might work OK-but I guess the other problems is not with ArcGIS Server (ADF's) but with the ArcObjects API. (standalone)

I 've got the same issue as well, trying to write a small console utilg and got the error. the same Code works OK if I'm doing it within a command class. (A new menu item within ArcMap ).

If anybody happens to resolve this, please reply

Pasting my code as well. (C #)
Got error "exception from hresult: 0x80040228"

 
//For example, server = "sde-server".            // Database = "P100.mydomain.no"            // Instance = "5151".            // User = "vtest".            // Password = "go".            // Version = "SDE.DEFAULT".            public IWorkspace OpenArcSDEWorkspace(string server, string instance, string user,            string password, string database, string version)            {            ESRI.ArcGIS.esriSystem.IPropertySet propertySet = new ESRI.ArcGIS.esriSystem.PropertySetClass();            propertySet.SetProperty("SERVER", server);            propertySet.SetProperty("INSTANCE", instance);            propertySet.SetProperty("DATABASE", database);            propertySet.SetProperty("USER", user);            propertySet.SetProperty("PASSWORD", password);            propertySet.SetProperty("VERSION", version);            IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactoryClass();            return workspaceFactory.Open(propertySet,0);            }            IWorkspace pWorkspace = OpenArcSDEWorkspace("sde-server", "5151", "myadm", "myadmpassword", "P100.mydomain.com", "SDE.DEFAULT");

  --
Knut Erik holund
Statoil ASA, Norway
   
• Top print reply alert moderator
Subject Re: connection to SDE Oracle
Author Knut Erik holund
Date Jul 19,200 7
Message OK-so this resolved the issue for me

I had forgot to initialise the arc-license! :-/

Used the following code in C #-And whola! -Connected.

 
            ESRI.ArcGIS.esriSystem.IAoInitialize a = new ESRI.ArcGIS.esriSystem.AoInitialize();            a.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcView);            

  --
Knut Erik holund
Statoil ASA, Norway
   
• Top print reply alert moderator
Subject Re: connection to SDE Oracle
Author Jeff bourdier
Date Jul 24,200 7
Message As a matter of fact, I 've just independently discovered that the same is true in my case. I had not yet initialized ArcObjects.

Funny, In the 9.1 version of this application, it worked without initializing ArcObjects. Apparently this changed in 9.2.

 
Private m_pAoInitialize As IAoInitialize            Private Sub initializeArcObjects()            m_pAoInitialize = New AoInitialize()            m_pAoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcView)            End Sub
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.