Select to view content in your preferred language

Connecting to SDE

883
1
12-06-2010 01:12 PM
BrianGustafson
Occasional Contributor
This code is creating an sde connection file correctly but when I try and get a list of the feature classes it says that there are 0, which is not the case.  What am I doing wrong to get a connection to SDE in python?

arcpy.CreateArcSDEConnectionFile_management(folderName, fileName, serverName, serviceName, databaseName, authType, username, password, saveUserInfo, versionName, saveVersionInfo)
env.workspace = "C:/temp/gpCon.sde"

fcs = arcpy.ListFeatureClasses()

for fc in fcs:
    print fc
0 Kudos
1 Reply
LoganPugh
Frequent Contributor
try arcpy.env.workspace
0 Kudos