1

Following example through ESRI is to access the features of file geodatabase (GDB), I would like to know that is there a similar way to do this with personal geodatabase (MDB) using Java.

I am quite new to ArcObjects so if anybody could point me to right direction.

nmtoken
13.6k5 gold badges39 silver badges91 bronze badges
asked May 30, 2013 at 5:41
2
  • Are you wedded to Personal Geodatabases rather than File Geodatabases? There is a Q & A available about their relative virtues. Commented May 30, 2013 at 6:04
  • Its not like "WEDDED", its just a tool generation to handle both geodatabase , so no PRO CONS . Commented May 30, 2013 at 6:07

1 Answer 1

3

You can use the AccessWorkspaceFactory instead. There are (at least) 3 ways to connect to a personal geodatabase. The simplest is probably the IWorkspaceFactory.OpenFromFile method, e.g.:

//For example, pathToFile= "C:\\myData\\mypGDB.mdb".
static IWorkspace openFromFile_pGDB_Workspace(String pathToFile)throws Exception{
 IWorkspaceFactory workspaceFactory = new AccessWorkspaceFactory();
 return workspaceFactory.openFromFile(pathToFile, 0);
}

See How to connect to a geodatabase in the conceptual help for more information.

You might also look at the various IGPUtilities helper methods if you want to deal with opening workspaces, feature classes, tables, etc. in a more generic way.

answered May 30, 2013 at 6:00

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.