2

I am creating an attachment table linking attachments from my local PC, saved in "C:\Temp\Match" to a Featureclass housed in a SDE Database on our GIS Server.

I can run the GenerateAttachmentMatchTable Tool from within ArcGIS and run it multiple times with no issue. The problem comes in when I try and run the tool from within a Python Script. I keep getting an Error:

ExecuteError: ERROR 000090: Error creating table, workspace may be read-only.

The folders are not read-only, I have checked and even changed the location of the output. The script has been modified and copied from the Geoprocessing Results Window and modified to be acceptable to a stand-alone script. Please see the code below:

import arcpy
InFeat = "Database Connections/xxx/_Enviro.DBO.MonPnt"
AttFolder = "C:\\temp\\Match1\\JPG"
OutTable = "C:\\temp\\Match1\\MatchTable"
LinkF = "Name"

arcpy.GenerateAttachmentMatchTable_management(in_dataset= InFeat, in_folder=AttFolder, out_match_table=OutTable, in_key_field=LinkF, in_file_filter="", in_use_relative_paths="RELATIVE")

The folder in question is not read-only and in fact has just been created to test this. There are no ArcMap documents linked to this folder, it only contains from images and a few text files I used to run some checks elsewhere in the script.

Running windows 7, 64-bit and ArcMap 10.4.1

6
  • 1
    The first thing I'd try is to supply the full path to the feature class that is not based on the Database Connections shortcut available from ArcMap. Go for r'C:\GISData\my.sde\enviro.dbo.monpnt' and see what happens. Commented Nov 10, 2017 at 7:35
  • What happens if you logout/login or reboot to be sure there are no other processes active and the test your Python script tool without opening any maps?
    – PolyGeo
    Commented Nov 10, 2017 at 7:35
  • Thank you all for your responses. @AlexTereshenkov I will try extract the Point file to a local drive, although it seems the problem is trying to save something. I have used the path in a previous task and it works, so I know it is correct. Commented Nov 10, 2017 at 11:08
  • @PolyGeo I have reset the PC multiple times and even tried the Microsoft "attrib -r +s C:\Temp\Match" "fix" I can get the process to run if I send it to memory, but that is a short term solution, I dont want to have to generate the table to memory each time I run it Commented Nov 10, 2017 at 11:11
  • Per the doc try adding ".dbf" to your output file name Commented Nov 11, 2017 at 7:08

1 Answer 1

0

Sounds like the script is attempting to write in the SDE workspace. Can you export the feature class from SDE and edit the script to work outside of SDE or version the feature class and target the version in your script?

Either way I think your problem is where the script is creating its working intermediate files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.