Arcpy to check if the AcceptConnections check box is True or False

456
6
04-01-2021 01:16 PM
StanMcShinsky
Regular Contributor

Is there a way to have a python script check if the AcceptConnections tool is set to True or False?

arcpy.AcceptConnections(admin_workspace, False) 

I need to check what the current state is in the enterprise geodatabase? 

Tags (2)
0 Kudos
6 Replies
BlakeTerhune
MVP Regular Contributor

Without knowing more context, it might be easier to simply attempt to do something and handle the exception otherwise. For example, if you need to connect but you're not sure if connections are allowed, just attempt to connect in a try block and handle the case it's denied in the except. Or, if you need to know if you need to turn connections back on, just turn it on (even if it's already on).

0 Kudos
StanMcShinsky
Regular Contributor

So I have a co worker that does some database administration stuff and he sometimes forgets to check the box to allow connections. I just want to have a quick little script that checks if he left it unchecked or not.

0 Kudos
BlakeTerhune
MVP Regular Contributor

Will you take any action based on the result or just ask your coworker if the current state is intended?

0 Kudos
StanMcShinsky
Regular Contributor

Yes action will be taken. Mostly an email will be sent to notify of the issue. If it is intended then at least he will know I am watching 🙂 

0 Kudos
DanPatterson
MVP Honored Contributor

why waste an email 😉 

DisconnectUser—ArcGIS Pro | Documentation


... sort of retired...
0 Kudos
StanMcShinsky
Regular Contributor

From what I can tell there must not be a property to describe the state of the check box. That is all I am looking for. I have another route I can go but if there was this option then that would make it easy. 

0 Kudos