Does anyone know of a method to convert a File Geodatabase Table into an Access 2007 Table programmatically. I have been trying using the PYODBC library and a series of insert statements but am having difficultly with some of the data types and NULL. Basically an unload to Access.
-
All the ESRI literature I have seen only covers the reverse, getting ACCDB files into ArcMap using an OLE DB connection, so great question!– blah238Dec 9, 2011 at 18:33
-
Do you have the Data Interoperability Extension or FME? If so that would probably be a lot easier to use than PYODBC.– blah238Dec 9, 2011 at 18:52
-
1I've not tried this but can't you simply use the Table to Table tool? Set up your OLE DB connection to Access in ArcCatalog then use the Table to Table geo-processing tool?– HornbyddDec 10, 2011 at 17:45
-
Hronbydd - I don't believe that ESRI provides write capabilities to an ole db connection string for Access 2007 - i have tried this and the tool failed, that is why i have begun going down the PYODBC path.– dklassenDec 12, 2011 at 16:58
2 Answers
Untested, but this should work: Create a personal geodatabase, import file-gdb into that, then open the resulting .mdb in Access 2007 and upgrade it from the Access side. If any of the source feature classes exceed 2gb you'll need to do add some logic for splitting things into pieces and recombining.
-
Yes this would work, unfortunately i want to add my table to an existing working database. We have an ongoing project that tables need to be added to monthly and this DB is already built in the ACCDB format. Thanks– dklassenDec 16, 2011 at 23:33
-
@dklassen, in that case what about using table-to-table to export and then suck them in on the Access side as linked tables? If the table names are predictable or static every time the Access db is opened they'll be current. Dec 20, 2011 at 5:13
Along the lines of this question, I wonder if you could pull the table out of the file geodatabase into a text file, then programmatically slurp the text file into Access? Here is a post on Stackoverflow to check out and here is a blog post on using Python with ADO.
-
This is basically what i have created. I have used the pyodbc library to connect to the Access DB and then looped through the File GDB table and create a series of Insert SQL Statements for the Access DB. Then execute them. Seems to work fine, but keeping track of all the possible data types is a bit overwhelming.– dklassenJul 6, 2012 at 6:00