You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Server .Net: Developing applications forum

How to connect geodatabase in 9.2 version w...   riyaz uddin Oct 21, 2007
Re: How to connect geodatabase in 9.2 versi...   Heming Zhu Oct 31, 2007
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject How to connect geodatabase in 9.2 version with VB6 
Author riyaz uddin 
Date Oct 21, 2007 
Message I have a VB application which work properly in 9.1 but after we upgrade from 9.1 to 9.2 the application fail to connect database. the error message is
Run-time error'-2147220952(80040228)
Automation error
I add the code and error image for view pls help how to solve this problem how to connect geodatabase
 
 
Dim ppropset As IPropertySet
Dim pWorkspaceFact As IWorkspaceFactory
Dim pWorkspace As IWorkspace
Dim pFeatWorkspace As IFeatureWorkspace
Dim pEnumDataset As IEnumDatasetName
Dim pDataset As IDatasetName

Set ppropset = New PropertySet
ppropset.SetProperty "CONNECTSTRING", "Data source=gisdata;User ID=sde;Password=admingisbgdata"

Set pWorkspaceFact = New OLEDBWorkspaceFactory
Set pWorkspace = pWorkspaceFact.Open(ppropset, 0)

'Error message display after this line'
'Run-time error'-2147220952(80040228)';
'Automation error'

Set pFeatWorkspace = pWorkspace
Set pEnumDataset = pWorkspace.DatasetNames(esriDTTable)
Set pEnumDataset = pWorkspace.DatasetNames(esriDTAny)
Set pDataset = pEnumDataset.Next
 
  error.JPG (opens in new window)
 
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How to connect geodatabase in 9.2 version with VB6 
Author Heming Zhu 
Date Oct 31, 2007 
Message Is your program a standalone VB program? If it is, then you have to add code to check out license. It's a new requirement for any standlone VB programs using arcobjects. It took me a while to realize it. Look at IAoInitialize for code sample to check out license. Let me know if you have further question