CreateArcSDEConnectionFile_management and transaction version dbo.DEFAULT selection

2646
4
09-25-2012 03:13 AM
JohnLay
Occasional Contributor
I am trying to make a database connection with the CreateArcSDEConnectionFile_management function in python. Everything works fine EXCEPT that I have to manually change the connection details to dbo.DEFAULT before the connection is usable (I have to do the same even if I am creating the connection through Catalog--Click the Change button in the Connection details section, Choose the dbo.DEFAULT, Click OK on the Connection Details dialog box to close it.)

Is this a known issue?
Is there a work around that can be scripted so that the user does not need to exit the script and manually perform this step?
Tags (2)
0 Kudos
4 Replies
JakeSkinner
Esri Esteemed Contributor
Hi John,

Are you specifying the 'version' parameter?  Ex:

arcpy.CreateArcSDEConnectionFile_management("C:/Projects","SQLEXPRESS", "SDE_SERVER","sde:sqlserver:SDE_SERVER/sqlexpress","Data","OPERATING_SYSTEM_AUTH","#","#","SAVE_USERNAME","dbo.DEFAULT","SAVE_VERSION")
0 Kudos
JohnLay
Occasional Contributor
Yep, I am specifying dbo.DEFAULT as the version parameter. Once the database connection is created, I have to manually edit the connection properties and specify dbo.DEFAULT as the version again before it will connect.

[HTML]database = r"Database Connections\CENSUS.sde"
if arcpy.Exists(database):
    pass   
else:
    arcpy.CreateArcSDEConnectionFile_management ("Database Connections", "CENSUS.sde", "CENSUS", "sde:sqlserver:00.00.000.000", "CENSUS", "DATABASE_AUTH", "USER", "PASS", "SAVE_USERNAME", "sde.DEFAULT", "SAVE_VERSION")[/HTML]
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Hi John,

According to the code you posted, you are specifying 'sde.default' (2nd to last parameter).  Try changing this to dbo.default.
0 Kudos
JohnLay
Occasional Contributor
Nope, wait. Looks like I DIDN'T specify dbo.DEFAULT as the version but sde.DEFAULT instead. I should have uploaded the script to begin with.

Thanks Jake for pointing that out.
0 Kudos