I can't connect to arcsde geodatabase

1184
4
Jump to solution
05-12-2012 01:00 PM
ben_abdallahmhd
New Contributor III
hello
good morning
i have a problem to connect to an arcsde geodatabase with python and i need help please

i use arcsde for single use (trial version of ArcGIS Desktop10)
i have stored a geodatabase in sqlserver with arcsde
i try to connect to this geodatabase with this python code but the connection failed, help please, thank you


>>> import arcpy >>> import sys >>> import os  >>> arcpy.CreateArcSDEConnectionFile_management("C:/connectionFiles","connect.sde","MKT/otc","sde:sqlserver:MKT/p10","BDP10TN_SIG","OPERATING_SYSTEM_AUTH","dbo.DEFAULT","DO_NOT_SAVE_VERSION")

<Result 'C:\\connectionFiles\\connect.sde'>



message:

Heure de début*: Fri May 11 17:37:35 2012
WARNING 000565: Impossible de se connecter au serveur.
réussie à Fri May 11 17:37:35 2012 (temps écoulé*: 0,00 secondes)
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
curtvprice
MVP Esteemed Contributor
what if you want to do it without an sde database connection?
say I am setting this up to be activated from arcpad instead


I think what Emad was getting at is if you drag and drop, the proper syntax will appear in your code. You can then use that code in your ArcPad app, or use that code as a template to build an appropriate connection string for a different user/database etc.

Another approach that I have found handy with difficult syntaxes is to do the operation using a tool interactively in ArcGIS Desktop (for example, run the Create Database Connection tool, taking advantage of the help and validation [parameter checks] in the tool interactive interface), and then copy python snippets from the Results window (right click > Copy Python Snippet). This approach can save you hours of frustration!

View solution in original post

0 Kudos
4 Replies
EmadAl-Mousa
Occasional Contributor III
Hi,

the easiest way is to drage and drop your ArcCatalog SDE Connection to your python IDE from ArcCatalog.
0 Kudos
GarrettMoeller
New Contributor III
what if you want to do it without an sde database connection?
say I am setting this up to be activated from arcpad instead and the user is remote so I want to use the ip address.
what would the syntax look like?
0 Kudos
curtvprice
MVP Esteemed Contributor
what if you want to do it without an sde database connection?
say I am setting this up to be activated from arcpad instead


I think what Emad was getting at is if you drag and drop, the proper syntax will appear in your code. You can then use that code in your ArcPad app, or use that code as a template to build an appropriate connection string for a different user/database etc.

Another approach that I have found handy with difficult syntaxes is to do the operation using a tool interactively in ArcGIS Desktop (for example, run the Create Database Connection tool, taking advantage of the help and validation [parameter checks] in the tool interactive interface), and then copy python snippets from the Results window (right click > Copy Python Snippet). This approach can save you hours of frustration!
0 Kudos
GarrettMoeller
New Contributor III
Excellent answer thank you!
0 Kudos