ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

AcceptConnections

  • Summary
  • Discussion
  • Syntax
  • Code sample

Summary

Allows an administrator to enable or disable the ability of nonadministrative users to make connections to an enterprise geodatabase.

Discussion

The AcceptConnections function is used by an administrative user to temporarily block connections to an Enterprise geodatabase. This function is used to complement the Connections tab on an Enterprise geodatabase properties page found in ArcGIS Desktop.

  • The AcceptConnections function must utilize an administrative connection to the database.
  • If this function is attempted to be run by a nonadministrative user the function will fail.

Syntax

AcceptConnections (sde_workspace, accept_connections)
ParameterExplanationData Type
sde_workspace

The Enterprise geodatabase that will have its connection property altered.

The connection properties specified in the Enterprise Geodatabase must be the geodatabase administrator.

String
accept_connections

Boolean value indicating if the geodatabase will accept connections (True) or will not accept connections (False).

Boolean

Code sample

AcceptConnections example 1

The following example demonstrates how to prevent connections to a geodatabase.

import arcpy

arcpy.AcceptConnections("C:\\MyProject\\admin.sde", False)
AcceptConnections example 2

The following example demonstrates how to prevent connections to a geodatabase, disconnect active connections, then run a geodatabase compress.

import arcpy

# Set Admin workspace variable
admin_workspace = "C:\\MyProject\\admin.sde"

# Block connections
arcpy.AcceptConnections(admin_workspace, False)

# Disconnect users
arcpy.DisconnectUser(admin_workspace, 'ALL')

# Reconcile/Post using default parameters.
arcpy.ReconcileVersions_management(admin_workspace, 'ALL_VERSIONS',
                                   'sde.DEFAULT', with_post='POST')

# Compress the geodatabase
arcpy.Compress_management(admin_workspace)

# Allow connections.
arcpy.AcceptConnections(admin_workspace, True)

Related topics

  • DisconnectUser
  • ListUsers

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal