Matshopp

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

Discussion created by Matshopp on Jul 22, 2013
Latest reply on Jul 23, 2013 by mzcoyle
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:

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 ?

Outcomes