<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV style="FONT-SIZE: 12px; COLOR: #909090; FONT-FAMILY: Arial Narrow">------------------</DIV>
<DIV>
<DIV>To the world you're little, but to a person you're the world.</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Chen Xuexia</DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; FONT-FAMILY: Arial Narrow">------------------&nbsp;Original&nbsp;------------------</DIV>
<DIV style="FONT-SIZE: 12px">
<DIV id=menu_sender><B>From: </B>&nbsp;"wow"&lt;27949218@qq.com&gt;;</DIV>
<DIV><B>Date: </B>&nbsp;Fri, Aug 1, 2008 11:21 AM</DIV>
<DIV><B>To: </B>&nbsp;"gdal-dev"&lt;gdal-dev@lists.osgeo.org&gt;; </DIV>
<DIV></DIV>
<DIV><B>Subject: </B>&nbsp;[gdal-dev] Update existing shape file</DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV style="FONT-WEIGHT: normal">
<DIV>Hi,</DIV>
<DIV>&nbsp; I wanna set new field value to an existing shape file which has been opened with update access, but it doesn't work, my code like this:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; OGRFeature* pFeature = pLayer-&gt;GetFeature(2); <BR>&nbsp; int nIdx = pFeature-&gt;GetFieldIndex("Name");<BR>&nbsp;pFeature-&gt;UnsetField(nIdx);<BR>&nbsp;pFeature-&gt;SetField( "Name", "hanJ reiver" );</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; Anyone give me some advices? </DIV>
<DIV style="FONT-SIZE: 12px; COLOR: #909090; FONT-FAMILY: Arial Narrow">------------------</DIV>
<DIV>
<DIV>To the world you're little, but to a person you're the world.</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Chen Xuexia</DIV></DIV></DIV>