I am opening an access db using vb.net from arcview. I open the db, perform a couple of make table queries and then add a new empty integer field into one of those tables and all performs properly. The problem comes when I try to update the new field based on other fields in that table. Below is a snippet. I always get an "Out of memory" error as soon as I get to the Update() line. It has been a while since I have done any coding. What have I forgotten? I shouldn't say all performs properly because I have been completely unable to close the db except manually. But that is another matter!
:banghead:
:banghead:
Code:
If Not FieldExists Then
tdf.Fields.Append(tdf.CreateField("Counter", vbInteger))
End If
strSQL = "SELECT * FROM tbltmpNewMinLands;"
rs = objAccess.CurrentDb.OpenRecordset("SELECT * FROM tbltmpNewMinLands")
PPIDOldVal = ""
Do While Not rs.EOF
PPIDVal = rs.Fields("lands").Value
If PPIDVal <> PPIDOldVal Then
Counter = 1
PPIDOldVal = PPIDVal
Else
Counter = Counter + 1
PPIDOldVal = PPIDVal
End If
With rs
.Edit()
rs.Fields("Counter").Value = Counter
.Update()
.MoveNext()
End With
Loop
rs.Close()