Arcgis server:Connection To SDE ORACLE

來源:互聯網
上載者:User
• Top Print Reply Alert Moderator   
Subject Connection To SDE ORACLE 
Author Mourad AbuSall 
Date Jun 25, 2007 
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, 2007 
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 would 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, 2007 
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, 2007 
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, 2007 
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, 2007 
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 should 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 Hollund 
Date Jul 19, 2007 
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 Hollund
Statoil ASA, Norway 
   
• Top Print Reply Alert Moderator   
Subject Re: Connection To SDE ORACLE 
Author Knut Erik Hollund 
Date Jul 19, 2007 
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 Hollund
Statoil ASA, Norway 
   
• Top Print Reply Alert Moderator   
Subject Re: Connection To SDE ORACLE 
Author Jeff Bourdier 
Date Jul 24, 2007 
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
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.