AnsweredAssumed Answered

ArcMap 10.3 python code won't run in 10.4

Question asked by Tonyalmeida on May 22, 2017
Latest reply on May 22, 2017 by Tonyalmeida

So i update from 10.3.1 to 10.4.1 Because i got a new PC and i am updating some scripts and addin buttons.  I have an addin button that updates points( personal SQL express database) based off of taxparcels. In 10.3.1 the addin works fine but now in 10.4.1 i am having issues. The only thing i changed was the name of the new workspace, the layer name stated the same. Not sure what's going on. Anyone have any ideas why it's not working in 10.4..1


Add-in Code:

arcpy.env.workspace = r"Database Servers\DSDGIS7WTALM_SQLEXPRESS.gds\TonyTwoWay (VERSION:dbo.DEFAULT)"  

        ptSelection = "TonyTwoWay.DBO.CCAP"          
        pointLayer = arcpy.env.workspace + os.sep + "TonyTwoWay.DBO.CCAP" #target point feature class
        parcel = "TaxParcels1"      
        parcel_lyr = 'In_memory\parcel_lyr'
        sjpoints = "In_memory\sjpoints"
        poly = "ACCOUNT_1"
        Pnt =  "Account"
        ptCount = int(arcpy.GetCount_management(pointLayer).getOutput(0))   


Error: I think it has to do with this line 4 "pointLayer = arcpy.env.workspace + os.sep + "TonyTwoWay.DBO.CCAP""

Traceback (most recent call last):
  File "C:\Users\talmeida\AppData\Local\ESRI\Desktop10.4\AssemblyCache\{473AD3F3-86EE-417D-A6A9-13DFBB4B2150}\", line 295, in onClick
    ptCount = int(arcpy.GetCount_management(pointLayer).getOutput(0))
  File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\", line 15779, in GetCount
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Rows: Dataset Database Servers\DSDGIS7WTALM_SQLEXPRESS.gds\TonyTwoWay (VERSION:dbo.DEFAULT)\TonyTwoWay.DBO.CCAP does not exist or is not supported
Failed to execute (GetCount).