How to write to .accdb?

1199
5
Jump to solution
06-20-2013 07:11 AM
KatharinaPalffy-Gelfand
New Contributor
Hi,
I have a script that writes data via an InsertCursor to a .mdb. Now that .mdb has been changed into an .accdb and my script does not work anymore. It is giving me an IO error that a specific table is not found. When I look in my .accdb, the table is there.
Do I need to connect to this new .accdb with the help of pyodbc? Does a regular insert cursor work then?
Your help would be appreciated.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MathewCoyle
Frequent Contributor
Katharina,

Try reading through this link. The short version is you should connect to it first using pyodbc or some other method before you access it.
http://support.esri.com/fr/knowledgebase/techarticles/detail/32976

View solution in original post

0 Kudos
5 Replies
MichaelVolz
Esteemed Contributor
Are you storing data in a personal geodatabase?  Are you running on a machine with a 64 bit operating system?
0 Kudos
KatharinaPalffy-Gelfand
New Contributor
Hi Michael,
yes, I am on a 64-bit operating system. Windows 7 Enterprise.
The data is stored in a file geodatabase.
0 Kudos
MichaelVolz
Esteemed Contributor
In your initial post you wrote about an insert cursor to a .mdb which I believe is a personal geodatabase, but in your next post you said file geodatabase.  Is it a personal or file geodatabase?

There was a thread about ESRI migrating away from personal geodatabases, so you may want to convert your .mdb to a file geodatabase (.gdb) and then run your script.

Look in the middle of this forum post for info from Mathew Coyle about personal geodatabases

http://forums.arcgis.com/threads/86999-Select-by-Attribute-and-Calculate-from-old-AML
0 Kudos
KatharinaPalffy-Gelfand
New Contributor
Hi Michael,
sorry to have confused you. Let me elaborate. I have a spatial database (file geodatabase) with my feature classes. Now I want to use arcpy.InsertCursor to write certain information from my feature classes like area and length to tables in an access database (.accdb). My question is: Do I need to connect to the .accdb first and can I then use arcpy.InsertCursor to write that information to it?
0 Kudos
MathewCoyle
Frequent Contributor
Katharina,

Try reading through this link. The short version is you should connect to it first using pyodbc or some other method before you access it.
http://support.esri.com/fr/knowledgebase/techarticles/detail/32976
0 Kudos