ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for 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
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Create ArcSDE Connection File

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Creates a database connection file to connect to an enterprise geodatabase using an ArcSDE service.

Usage

  • The ArcSDE Connection File Name must include an .sde file extension.

  • When valid connection information is entered, the tool populates the versions list with the geodatabase versions that the connected user has permissions to access.

  • If you want to prevent your connection information from being saved in the Results window or stored in the geoprocessing history log files, disable history logging and save the connection file without saving any connection information you don't want exposed.
  • This tool should only be used to create application server (ArcSDE service) connections to a 10.2.2 or earlier release geodatabase. If you want to connect to a 10.3 or later release geodatabase, or connect directly to a 10.2.2 or earlier release geodatabase, use the Create Database Connection tool instead.

Syntax

CreateArcSDEConnectionFile_management (out_folder_path, out_name, server, service, {database}, {account_authentication}, {username}, {password}, {save_username_password}, {version}, {save_version_info})
ParameterExplanationData Type
out_folder_path

The folder path where the .sde file will be stored.

Folder
out_name

The name of the connection file. Use the .sde file extension.

String
server

The name of the machine where the ArcSDE application server is installed.

String
service

The ArcSDE service name or TCP port number.

String
database
(Optional)

The name of the database to connect to. Do not provide a database name when connecting to Oracle.

String
account_authentication
(Optional)
  • DATABASE_AUTH —Database Authentication. Uses an internal database user name and password to connect to the DBMS. You aren't required to type your user name and password to create a connection; however, if you don't, you will be prompted to enter them when a connection is established.
  • OPERATING_SYSTEM_AUTH —Use Operating system authentication. You do not need to type a user name and password. The connection will be made with the credentials used to log in to the operating system. If the login used for the operating system is not a valid geodatabase login, the connection will fail. Also note you cannot make an ArcSDE service connection using operating system authentication to a geodatabase stored in Oracle, DB2, or Informix.
Boolean
username
(Optional)

Database user name to connect with when using Database Authentication.

String
password
(Optional)

The database user password when using Database Authentication.

Encrypted String
save_username_password
(Optional)
  • SAVE_USERNAME —Save the user name and password in the connection file.
  • DO_NOT_SAVE_USERNAME —Do not save the user name and password in the file. Every time you connect using the file, you will be prompted for a user name and password.
Boolean
version
(Optional)

The geodatabase version to connect to. By default, connections are made to the DEFAULT version.

String
save_version_info
(Optional)
  • SAVE_VERSION —Save the version name in the connection file.
  • DO_NOT_SAVE_VERSION —Do not save the version name in the connection file. Without the version name being saved with the file, a connection to the DEFAULT version will be made the next time you access the connection file.
Boolean

Code sample

CreateArcSDEConnectionFile example 1 (Python window)

The following Python window script demonstrates how to use the CreateArcSDEConnectionFile function in immediate mode.

import arcpy
arcpy.CreateArcSDEConnectionFile_management(r'c:\connectionFiles',
                                            'gpserver',
                                            '5151',
                                            '',
                                            'toolbox',
                                            'toolbox',
                                            'SAVE_USERNAME',
                                            'SDE.DEFAULT',
                                            'SAVE_VERSION')
CreateArcSDEConnectionFile example 2 (stand-alone script)

The following stand-alone script is an example of how to apply the CreateArcSDEConnectionFile function in scripting.

# CreateArcSDEConnection.py
# Description: Simple example showing use of CreateArcSDEConnectionFile tool
 
# Import system modules
import arcpy

# Set variables
folderName = r"c:\connectionFiles"
fileName = "Connection to gpserver.sde"
serverName = "gpserver"
serviceName = "5151"
databaseName = ""
authType = "DATABASE_AUTH"
username = "toolbox"
password = "toolbox"
saveUserInfo = "SAVE_USERNAME"
versionName = "SDE.DEFAULT"
saveVersionInfo = "SAVE_VERSION"

# Process: Use the CreateArcSDEConnectionFile function
arcpy.CreateArcSDEConnectionFile_management (folderName,
                                             fileName,
                                             serverName,
                                             serviceName,
                                             databaseName,
                                             authType,
                                             username,
                                             password,
                                             saveUserInfo,
                                             versionName,
                                             saveVersionInfo)

Environments

  • Current Workspace

Licensing information

  • ArcGIS for Desktop Basic: No
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • An overview of the Workspace toolset
  • Viewing tool execution history

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal