Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm stumped here. I've seen this error in other posts but not quite in the same context. I'm trying to run the arcpy.management.CreateRelationshipClass() tool in ArcGIS 10.0. Absolutely everything I've tried throws the 000840 error. I ultimately want to run the tool from a Python script, but for now I'm trying in the Python window in ArcMap. Here's my code:

import arcpy
from arcpy import env
env.workspace = 'C:/mulleady'
arcpy.management.CreateRelationshipClass('temp/SOIL_HYDROGROUP.dbf',
    'temp/WUH_Soil_Statistics.dbf', 'temp/relclass', 'SIMPLE', 'forward',
    'backward', 'NONE', 'ONE_TO_MANY', 'NONE', 'IL_SOIL', 'IL_SOIL')

I tried \\ instead of / in the pathnames, I tried to name the directory temp.gdb instead of temp, I ran arcpy.ValidateFieldName(), I tried absolute paths, I've tried a bunch of stuff that hasn't worked.

An even stranger thing to me is, is that I'm getting the same error even when I try to run the tool from ArcToolbox > Create Relationship Class:

CreateRelationshipClass_error

Any thoughts?

Edit

I created a file geodatabase and copied my two .dbf files into it. Now when I try to create a relationship class I get this error. I changed my workspace and scratch workspace to the path of the fgbd folder. What am I doing wrong now?

CreateRelationshipClass_error_2

share|improve this question

2 Answers 2

up vote 1 down vote accepted

For the example you show the output relationship class is not a path, but simply the name you want for the new relationship. AND it has to be contained within a geodatabase. You can't create a relationship class on stand alone .dbf files in a standard folder. Create a file geodatabase, import your dbf files into the fgdb and then create the relationship class.

share|improve this answer
    
Thank you for the explanation. I'll see if I can get it to work. –  Kyle M Jul 11 '13 at 23:28

It looks like you're still using a path for the relationship class name, that should only be the name you want for the relationship. Also, if you copied the .dbf tables into your file geodatabase they should not have .dbf at the end of the name. I think this may be confusing ArcGIS. When you have tables in the geodatabase they do not need a file extension at the end of their name. Make sure you are using the browse buttons to select your inputs when you try this again. If you do have the .dbf at the end of your tables in your geodatabase the. You should rename them in ArcCatalog and drop the file extensions.

share|improve this answer
    
Got it, thank you. –  Kyle M Jul 16 '13 at 22:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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