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<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"Database Servers\DSDGIS7WTALM_SQLEXPRESS.gds\TonyTwoWay (VERSION:dbo.DEFAULT)"</SPAN>
ptSelection <SPAN class="operator token">=</SPAN> <SPAN class="string token">"TonyTwoWay.DBO.CCAP"</SPAN>
pointLayer <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">+</SPAN> os<SPAN class="punctuation token">.</SPAN>sep <SPAN class="operator token">+</SPAN> <SPAN class="string token">"TonyTwoWay.DBO.CCAP"</SPAN> #target point feature <SPAN class="keyword token">class</SPAN>
<SPAN class="token class-name">parcel</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="string token">"TaxParcels1"</SPAN>
parcel_lyr <SPAN class="operator token">=</SPAN> <SPAN class="string token">'In_memory\parcel_lyr'</SPAN>
sjpoints <SPAN class="operator token">=</SPAN> <SPAN class="string token">"In_memory\sjpoints"</SPAN>
poly <SPAN class="operator token">=</SPAN> <SPAN class="string token">"ACCOUNT_1"</SPAN>
Pnt <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Account"</SPAN>
ptCount <SPAN class="operator token">=</SPAN> <SPAN class="token function">int</SPAN><SPAN class="punctuation token">(</SPAN>arcpy<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetCount_management</SPAN><SPAN class="punctuation token">(</SPAN>pointLayer<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">getOutput</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
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}\AddinToolsButtons_addin.py", line 295, in onClick
ptCount = int(arcpy.GetCount_management(pointLayer).getOutput(0))
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\management.py", 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).
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>