0

I am trying to use python to create a relationship class between a feature class and dbf. I keep getting,

"ERROR 000177: Relationship classes can only be created in the same database that contains the feature classes or tables."

The solution seems obvious; however, I am certain that the feature class and dbf are located in the same geodatabase, as I have the tool test the existence of each feature and then print their paths to the geoprocessing window.

I've tried switching to UNC paths as well as building the relationship class in model builder and integrating it into my tool as a python script. This is also a problem which arises both as a script tool with user input as well as with the hard-coded values.

Update: I should also mention that I am able to create a relationship class with these features in ArcMap. It just isn't working in python.

  • 2
    A .dbf file is a file and cannot be referenced as a table within a geodatabase. Try importing it into the database. – artwork21 May 29 '15 at 12:42
  • Do you mean by using TableToTable or TableToDBASE? – Olivia May 29 '15 at 12:48
  • I'm not sure what the table is in my gdb actually. It doesn't have a .dbf extension, so I guess it isn't a dbf then. I tried putting TableToDBASE into my code without any luck. Same error. – Olivia May 29 '15 at 14:07
1

Originally, my input variables were:

fc = gdbLocation + "/fc"
table = gdbLocation + "/table"

I changed them to:

fc = gdbLocation + "\\fc"
tables = gdbLocation + "\\table"

And my issue appears to be resolved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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