>>Shouldn't this:
>> ' 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)
>> Next
be:
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.
>
>The Data class always exposes the oDataView once a SQL select has been done.
>
>The oData.nCount is the same as oData.oDataView.Count as this is also initialized from the Data class once a SQL select command is executed.
>
>Now, as far as scanning the rows and assigning them to loRow, oRows is initialized like this at the Data class level:
>
>
> ' If we have no record
> If nCount = 0 Then
> oRows = Nothing
> Else
> oDataView = oDataSet.Tables("Temp").DefaultView
> oRows = oDataSet.Tables("Temp").Rows()
> End If
>
>
>So, the way oRows is initialized here, is it the same thing as oData.oDataView.Item?
I don't think I'm getting across (or I'm badly misunderstanding what you are doing) :-}
A DataView does NOT change the way a table is seen when it is accessed directly. It's a 'lens' through which to view the table. If you want the sort order of the DataView to be used then you must iterate the DataView NOT the table.