Select to view content in your preferred language

referencing a table from a .mdb file

787
1
11-30-2011 06:53 AM
WayneHajas
Emerging Contributor
I am working with join and relates commands.

In the GUI, I can reference tables from a .mdb (microsoft access) file. I would like to be able to do the same from a python script.

Instead of arcpy.AddJoin_management( "veg_layer", "HOLLAND95", "vegtable.dbf", "HOLLAND95"), I would like to use something like arcpy.AddJoin_management( "veg_layer", "HOLLAND95", TABLEinMDB, "HOLLAND95"). I just have no idea what the syntax for TABLEinMDB would be. Does anybody have any ideas?

As an aside, is there some sort of feature logging feature in ARCGIS that would help to sort out these types of issue?

Thanks in advance!
Wayne
Tags (2)
0 Kudos
1 Reply
JamesHood
Regular Contributor
For example
import arcpy

#Option1
MDB = "c:\temp\tables.mdb\"
table = "vegtable" 

arcpy.AddJoin_management( "veg_layer", "HOLLAND95", MDB + table, "HOLLAND95")




#Option2
TABLEinMDB = "c:\temp\tables.mdb\vegtable"

arcpy.AddJoin_management( "veg_layer", "HOLLAND95", TABLEinMDB, "HOLLAND95")


Note: should not require the table end in .dbf  if it is located within a .mdb.
0 Kudos