Select to view content in your preferred language

'ESRI.ArcGIS.Geodatabase.RecordSet' cannot be indexed because it has no default prop

464
0
06-01-2011 01:19 PM
BrijeshSingh1
Deactivated User
Hi,
I am new to ArcGIS, I am upgrading some old code from 9.31 to 10. I am getting this error
"Interface 'ESRI.ArcGIS.Geodatabase.RecordSet' cannot be indexed because it has no default property"

' Load the forecast year information
Dim pProjectionsTable As ESRI.ArcGIS.Geodatabase.RecordSet
pProjectionsTable = pForecastInputDatabase.OpenRecordset("Projections")

' Determine the index of the last projection year
' It's the number of records in the Projections table - 2 (because we don't count the lag year)
pProjectionsTable.MoveLast()

Dim indexOfLastProjectionYears As Short
indexOfLastProjectionYears = pProjectionsTable.recordCount - 2

Dim allProjectYears() As Short
ReDim Preserve allProjectYears(indexOfLastProjectionYears)

' Go to the first record in the database
pProjectionsTable.MoveFirst()

' Skip over the lag year
pProjectionsTable.MoveNext()

Dim j As Short
For j = 0 To indexOfLastProjectionYears
allProjectYears(j) = CShort(pProjectionsTable!F1) pProjectionsTable.MoveNext()
Next j

I get the error at the point marked in red.

Please help

Thanks in advance.

Brij
0 Kudos
0 Replies