Updating Tables in MDF Database

1682
3
05-06-2016 08:02 AM
MitchHolley1
MVP Regular Contributor

I'm trying to write a script that will update records in an MDF database (SQL Sever Express).  I was looking into using the pyodbc module and update the fields with Python.  Is this possible?  Has anyone connected and updated a MDF database this way?

This is what I have so far.

Is it worth it to continue with this script?  Or am I wasting my time?

Thanks for the help!

Tags (3)
0 Kudos
3 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Mitch,

Quick question, is this a geodatabase in SQL Server Express?  Or is it strictly a database (i.e. no feature classes, or SDE repository)?

If this is a geodatabase, and the tables are registered with the geodatabase, you should use the arcpy.da.UpdateCursor to make the update.

MitchHolley1
MVP Regular Contributor

Jake,

Thanks for the response.  It is a geodatabase, and it does sit in SQL Server Express.  I'll see if I can connect with arcpy.

Thanks again!

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

did it print your last statement? any errors? or it just did nothing?

0 Kudos