Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

CreateDatabaseConnection_management doesn't return an error for no-existing user

$
0
0
I've tested the "arcpy.CreateDatabaseConnection_management" and I found out that, unlike the manual process, it's possible to create a connection file from invalid user's login without receiving any alert message:

Code:

try:
    arcpy.CreateDatabaseConnection_management(my valid parameters, non-existing user)
except Exception as (e):
    return

The connection file is created anyway.

Should it be possible to had a new parameter to the method in order to check if the connection works ? (like the "validate" parameter of the MapDocument "findAndReplaceWorkspacePaths" method ) ?

For now I fixed it by using "arcpy.ListUsers(myConnection)" to test the connection.
Is there a better way of doing it ?

Viewing all articles
Browse latest Browse all 2485

Trending Articles