Problem with Calculate Field tool

3622
1
Jump to solution
07-16-2014 07:48 PM
PeterBuxton
New Contributor II

I am attempting to do a field calculation in 10.1 using the Calculate Field tool with a VB script code block. If I run the code in the Field Calculator tool within ArcMap, it works perfectly. However if I run exactly the same script in the Calculate Field tool within a model, the tool appears to run, but the resultant fields are all empty. If I run the Calculate Field tool independently (ie not in the model), it fails with "Error 000622 ....parameters are not valid" and "Error 000989 CalculateField cannot use VB expressions for services". The script is essentially concatenating two fields into a third field ([ChemVal] and dealing with the fact that one of the two source fields can have Null values which need to be converted to a string before concatenation.

 

The expression is:

ChemVal = NewVal

 

and the code block is:

Dim NewVal

If [Chem_Value_Range] = "" Then

NewVal = String( [Chem_Value_Range] ) & [Chem_Value]

Else

NewVal = [Chem_Value_Range] & [Chem_Value]

End if

0 Kudos
1 Solution

Accepted Solutions
PeterBuxton
New Contributor II

I may have just answered my own question. Linking to Error 000989 from the geoprocessing results had described the issue as a Python Syntax Error - which was meaningless since I was using VB (Thanks ESRI!!!) However searching Google on "CalculateField cannot use VB expressions for services" revealed revealed and error 24046 which says you cant use VB with 64 bit background processing. I guess this may be the problem. Now I have to go and learn Python....GRRRRRRRRRRR!

View solution in original post

0 Kudos
1 Reply
PeterBuxton
New Contributor II

I may have just answered my own question. Linking to Error 000989 from the geoprocessing results had described the issue as a Python Syntax Error - which was meaningless since I was using VB (Thanks ESRI!!!) However searching Google on "CalculateField cannot use VB expressions for services" revealed revealed and error 24046 which says you cant use VB with 64 bit background processing. I guess this may be the problem. Now I have to go and learn Python....GRRRRRRRRRRR!

0 Kudos