Issues with DataManagementTools.CalculateField in VB.net and ArcGIS 10

2253
1
03-01-2011 01:58 PM
EricBuehler
New Contributor II
Hello,  I'm attempting to upgrade my 9.3 vb.net code to Arc10.  I have several lines of code that used to update the field values in a table (found in a pgdb).  I can't seem to figure out why the table fields are no longer being updated in my Arc10 code.  The section of code is found below.  Any help/ideas would be much appreciated.

' Calculate values
            Dim GPcalculateField As New CalculateField
            GPcalculateField.in_table = LIQUOR_GDB_PATH & LIQUOR_TEMP_GDB & "\" & NEW_APPLICANTS_TABLE
            Dim strField As String() = {"Name", "Address", "LicenseType", "DateRevised", "Approved", "City"}
            For Each field As String In strField
   GPcalculateField.field = field
                   Select Case field
                           Case "Address"
                                   GPcalculateField.expression = """" & strAddress & """"
                           Case "Name"
                                   GPcalculateField.expression = """" & strName & """"
                           Case "LicenseType"
                                   GPcalculateField.expression = """" & strLiquorType & """"
                           Case "DateRevised"
                                   GPcalculateField.expression = """" & strDate & """"
                           Case "Approved"
                                   GPcalculateField.expression = """" & strApproved & """"
                           Case "City"
                                   GPcalculateField.expression = """" & "Greeley" & """"
                    End Select


                    If RunTool(GP, GPcalculateField, Nothing) = 0 Then
                           MessageBox.Show("Could not calculate fields." & ControlChars.CrLf & "See debug info." & ControlChars.CrLf & "Ending Application.", "Liquor License Application", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
                           FinishTasks(GP)
                           Exit Sub
                    End If
            Next field
0 Kudos
1 Reply
jp
by
New Contributor II
Hi,

Have you found any solution?
I am having same issues. Python script works but VBScript doesn't. Both the scripts work find in ArcMap.

!Name!.split("-")[0]

Split( [Name] ," - ", -1)(0)

Thanks!
0 Kudos