<DIV> </DIV>
<DIV> </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> Chen Xuexia</DIV></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; FONT-FAMILY: Arial Narrow">------------------ Original ------------------</DIV>
<DIV style="FONT-SIZE: 12px">
<DIV id=menu_sender><B>From: </B> "wow"<27949218@qq.com>;</DIV>
<DIV><B>Date: </B> Fri, Aug 1, 2008 11:21 AM</DIV>
<DIV><B>To: </B> "gdal-dev"<gdal-dev@lists.osgeo.org>; </DIV>
<DIV></DIV>
<DIV><B>Subject: </B> [gdal-dev] Update existing shape file</DIV></DIV>
<DIV> </DIV>
<DIV style="FONT-WEIGHT: normal">
<DIV>Hi,</DIV>
<DIV> 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> </DIV>
<DIV> OGRFeature* pFeature = pLayer->GetFeature(2); <BR> int nIdx = pFeature->GetFieldIndex("Name");<BR> pFeature->UnsetField(nIdx);<BR> pFeature->SetField( "Name", "hanJ reiver" );</DIV>
<DIV> </DIV>
<DIV> 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> Chen Xuexia</DIV></DIV></DIV>