AnsweredAssumed Answered

Creating table inside .mdb database using arcpy.CreateTable_management. I have an access mdb database and I want to use arcpy.CreateTable_management to create a table inside the .mdb. How?

Question asked by hackerp on Jun 3, 2016
Latest reply on Jun 8, 2016 by hackerp

I have an access mdb database and I want to use arcpy.CreateTable_management to create a table inside the .mdb.

 

This works to make the DB using Python:

config_keyword = ""

mdb = ".mdb"

out_folder_path = "C:/output"

out_name = "CountyCode_MapGrid_"

name = "newDB"

 

arcpy.CreatePersonalGDB_management(out_folder_path, out_name + name + mdb)

 

And it works fine but to get a table created INSIDE the .mdb using:

   arcpy.CreateTable_management(out_folder_path, "Block_77", config_keyword)

    arcpy.AddField_management(out_name, "OBJECTID", "AutoNumber")

    arcpy.AddField_management(out_name, "SHAPE", "OLE Object")

    arcpy.AddField_management(out_name, "id_block", "Number")

    arcpy.AddField_management(out_name, "id_mapgrid", "Number")

    arcpy.AddField_management(out_name, "map_number", "Short Text")

    arcpy.AddField_management(out_name, "Block", "Short Text")

    arcpy.AddField_management(out_name, "SHAPE_Length", "Number")

    arcpy.AddField_management(out_name, "SHAPE_Area", "Number")

    arcpy.AddField_management(out_name, "created_user", "Short Text")

    arcpy.AddField_management(out_name, "created_date", "Date/Time")

    arcpy.AddField_management(out_name, "last_edited_user", "Short Text")

    arcpy.AddField_management(out_name, "last_edited_date", "Date/Time")

 

Does not work. Any suggestions?

 

Thanks!

Outcomes