AnsweredAssumed Answered

Arcpy Python 3.6 MDB table

Question asked by rwmeier on May 1, 2018
Latest reply on May 1, 2018 by Dan_Patterson

I can use a da.searchcursor to connect to an mdb table using Pyhton 2.7, but when I try the exact same code in Python 3.6, I get an error that it cannot find the table. When I use the same exact code and point it to a gbd table it works fine

 

Did I miss something that python 3.6 and arcpy will not connect to mdb tables?

 

here's the code:

 

import arcpy

dataPath = "G:\\ArcGIS\\Standards\\Tools_and_Scripts\\SmokeTesting"
dbName = "17-078_Smoke_Field_KCMO_OCP.mdb"
sectionTbl = dataPath + "\\" + dbName +"\\tblSmkSewerSectionTable"

tbl = "G:\\ArcGIS\\Standards\\Tools_and_Scripts\\SmokeTesting\\17-078_Smoke_Field_KCMO_OCP.mdb\\tblSmkSewerSectionTable"

tblGD = "G:\\ArcGIS\\Standards\\Tools_and_Scripts\\MACP_Processing\\memphis_macp_test\\memphis_manhole_inspections_17_025_phase_5.gdb\\memphis_manhole_inspections_17_025_phase_5"

with arcpy.da.SearchCursor(tbl, '*') as cursor:
for row in cursor:
print('{0}, {1}, {2}'.format(row[0], row[1], row[2]))

 

 

and the error - 

 

Traceback (most recent call last):
File "G:\ArcGIS\Standards\Tools_and_Scripts\mdbTest.py", line 9, in <module>
with arcpy.da.SearchCursor(tbl, '*') as cursor:
RuntimeError: cannot open 'G:\ArcGIS\Standards\Tools_and_Scripts\SmokeTesting\17-078_Smoke_Field_KCMO_OCP.mdb\tblSmkSewerSectionTable'

Outcomes