I am trying to edit data that is in an ArcSDE Oracle database with updates in a file geodatabase. I want to be able to make these changes on a separate version to isolate them.
If I connect to a version created through ArcMap 10.2.1, I am able to edit and apply changes and they can be seen through the GUI. I want to be able to create a version through the python script and then apply the changes to that version.
However, when the code invokes the edit = arcpy.da.Editor(myconnect) command it returns the error:
edit = arcpy.da.Editor(myconnect)
RuntimeError: The database was not found.
There doesn't seem to be much I can find on the web about this error. The code below is how I create the version but is currently commented out to simplify the debugging process.
Initially I would connect without trying to connect to the version directly and as annoying as it seems, when editing each feature, I would create a layer for that, then change the version for that layer. However, I was unable to get that to work and then thought I could just connect to the version directly. So much for that idea! The objects are ArcFM features, I wouldn't think that has anything to do with it but as I've found out before, I could well be wrong!
Here is the abbreviated code I have:
app = Dispatch('Miner.Framework.Dispatch.MMAppInitializeDispatch')
au = Dispatch('Miner.Framework.Dispatch.MMAutoupdaterDispatch')
runtime = Dispatch('Miner.Framework.Dispatch.MMRuntimeEnvironmentDispatch')
runtime.RuntimeMode = mmRuntimeMode.mmRuntimeModeArcServer
app.Initialize(mmLicensedProductCode.mmLPArcFM)
au.AutoUpdaterMode = mmAutoUpdaterMode.mmAUMNoEvents
try:
versionBase="script-test"
versionName="%s.%s" % (user, versionBase)
## myconnect = sdeConnection.connect("", "FMSQA", user, password,"")
## found = False
## for version in arcpy.da.ListVersions(myconnect):
## if versionName in version.name:
## found = True
## break
## if (found == False):
## arcpy.CreateVersion_management(myconnect, "SDE.DEFAULT", versionBase, "PUBLIC")
myconnect = sdeConnection.connect("", "FMSQA", user, password, versionBase)
arcpy.env.workspace = myconnect
edit = arcpy.da.Editor(myconnect)
My database connection code is basically taken from here https://gis.stackexchange.com/a/17028/14120