' Sort the dataset into the primary key oData.oDataView.Sort = "AI" ' For each record For lnCounter = 0 To oData.nCount - 1 loRow = oData.oRows(lnCounter) Nextbe:
oData.oDataView.Sort = "AI" ' For each record For lnCounter = 0 To oData.oDataView.Count - 1 loRow = oData.oDataView.Item(lnCounter) Next(Haven't checked the exact syntax). Once again: you are looping through the table in the first case - the DataView may as well not exist.