Buscar este blog

lunes, 31 de marzo de 2008

Conexion a ArcSDE

'Funcion para conectarse a sde
Public Function conectaMetamodelo() As ESRI.ArcGIS.Geodatabase.IFeatureWorkspace
Dim pConfig As Configuracion
Dim pPropSet As IPropertySet
Dim pWksFact As IWorkspaceFactory
Dim pFWks As IFeatureWorkspace
Try
pConfig = Configuracion.getConfigurador
pPropSet = New PropertySet
With pPropSet
.SetProperty("SERVER", pConfig.rutaServidor)
.SetProperty("INSTANCE", pConfig.rutaInstancia)
'.SetProperty("DATABASE", pConfig.PathDatabase)
'.SetProperty("USER", "********")
'.SetProperty("PASSWORD", "******")
.SetProperty("USER", pConfig.rutaUser)
.SetProperty("PASSWORD", pConfig.rutaPassw)
.SetProperty("VERSION", pConfig.rutaVersion)
End With
pWksFact = New SdeWorkspaceFactory
pFWks = pWksFact.Open(pPropSet, 0)

Return pFWks
Catch ex As Exception
Throw ex
End Try
End Function

No hay comentarios: