1

I have a tool in a Python toolbox. As a parameter, I want to let the user select an existing (or possibly create a new) SDE connection. What value for datatype should I use for this?

I have tried DERemoteDatabaseFolder, definied by the documentation as:

The database connection folder in ArcCatalog.

However, it only lets me select files of mysterious "Basic Types" and does not show me any SDE files. I also tried DEFile, setting param.filter.list = ['sde']. But that options required the user to find the SDE files on her own, which is not so easy if they are located somewhere in the AppData\Roaming folder.

Is there any better alternative?

  • 2
    Try 'workspace' – KHibma Nov 17 '15 at 13:44
4

@KHibma is right. Use DEWorkspace

def getParameterInfo(self):
    param0 = arcpy.Parameter(
        displayName="Input Sde Connection",
        name="in_conn_file",
        datatype="DEWorkspace",
        parameterType="Required",
        direction="Input")

To limit the choices:

param0.filter.type = "Workspace"
param0.filter.list = ["Remote Database"]
  • What if that doesn't work with your script? – user125266 Apr 24 '19 at 18:53

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.