Using UtilitySolutions.py to convert access .mdb to geodatabase

266
1
09-03-2020 08:55 AM
ThomasChung1
New Contributor

Hi there, I tried to using Utilitysolution.py to import access .mdb file.

Below is my script modified from CCTV Manager's page Import Access Tables—Tool Reference | ArcGIS Solutions :
# Name: ImportAccessTables.py
# Description: Converts tables in an Access database to file geodatabase.

# Import required modules
import arcpy

# Local Variables
mdb = "K:\\GIS_Folder\\Data\\Well_Reports.mdb"
tables = ['Wells', 'Well_Reports']
out_folder_path = "K:\\GIS_Folder\\Data\\Waterwells"
out_name = "Well_Reports_converted"
import_type = "DATA"

arcpy.utilsol.ImportAccessTables(mdb,
tables,
out_folder_path,
out_name,
import_type)

But I have runtime error that I do not know how to solve:

RuntimeError                              Traceback (most recent call last) 
In  [5]: 
Line 18:    import_type)  

File C:\Users\tchung\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\utilsolutions\esri\arcpy\UtilitySolutions.py, in ImportAccessTables: 
Line 44:    [mdb, tables, out_folder_path, out_name, import_type])  

File C:\Users\tchung\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\utilsolutions\esri\arcpy\UtilitySolutions.py, in _runner: 
Line 17:    raise e  

File C:\Users\tchung\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\utilsolutions\esri\arcpy\UtilitySolutions.py, in _runner: 
Line 15:    return convertArcObjectToPythonObject(func(*gp_fixargs(args, True)))  

File c:\users\tchung\appdata\local\programs\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py, in <lambda>: 
Line 511:   return lambda *args: val(*gp_fixargs(args, True)) 
RuntimeError: Object: Error in executing tool---------------------------------------------------------------------------

 

0 Kudos
1 Reply
ThomasChung1
New Contributor

Finally I get this ImportAccessTables running. 

I go to https://solutions.arcgis.com/shared/help/utility-solutions/get-started/faq.htm#anchor2 and use python command prompt to install "utilsolutions" on my clone envs.  

Using proswap to swap to clone envs,  I run the python script without problem. 

0 Kudos