Blog

Check Version of Geodatabase using ArcObject.

Posted by Yogesh Sharma Blogs | ArcObject Nov 05, 2012
Check Version of Geodatabase using ArcObject.

Check Version of File Geodatbase/Personal  geodatabse using ArcObject-

We have File Geodatabase of Personal Geodatabase and we want to check version of That Geodatabase.

IWorkspaceFactory pwsf = new AccessWorkspaceFactoryClass();

IWorkspace pws = pwsf.OpenFromFile(@"E:\ARC_PRACTICE\Sample_data\FP_MDBs\FL_01.mdb", 0);

IGeodatabaseRelease2 pGeorel = pws as IGeodatabaseRelease2;

int majVer= pGeorel.MajorVersion;

int minVer = pGeorel.MinorVersion;

 Boolean chkVersionLvl = pGeorel.CurrentRelease;

here majver have values 1,2,3  means major version is 7 plus that number-

if majver is 1 means version is 8.X

if majver is 2 means version is 9.X

if majver is 3 means version is 10.X

if minver is 1 and majver=1 means version is 8.1.

if minver is 2 and majver=2 means version is 9.2.

if minver is 0 and majver=3 means version is 10.0.

 

 One more thing if we want only the geodatabse version is equal to current version level or not then use-


Boolean chkVersionLvl = pGeorel.CurrentRelease;

if chkVersionLvl =True then both version is same(geodatabse and ArcGis)

if chkVersionLvl =False then both version is Different(geodatabse and ArcGis)


 

post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Get Career Advice from Experts