In a VB 6.0 application, I am trying to get the selected records from a table or query using the following method:

Public Function GetTableRecords(ap_Application As Access.Application, TableName As String, CurrentRow As Long, SelectedCount As Integer) As Object

Dim lobj_Table As Object 'Access.Form
Dim li_Return As Integer

  li_Return = ap_Application.SysCmd(acSysCmdGetObjectState, acTable, TableName)
  If li_Return = 0 Then
  'Object is not open
    Set GetTableRecords = Nothing
    Exit Function
  End If
  'Make the table active
  ap_Application.DoCmd.OpenTable TableName
  Set lobj_Table = ap_Application.Screen.ActiveDatasheet
  If lobj_Table Is Nothing Then
    Set GetTableRecords = Nothing
    Exit Function
  End If
  CurrentRow = lobj_Table.SelTop
  SelectedCount = lobj_Table.SelHeight
  If SelectedCount = 0 Then
    SelectedCount = lobj_Table.RecordsetClone.RecordCount
  End If
  'DAO recordset for MDB, MDE, MDA
  'ADO recordset for ADO, ADE
  Set GetTableRecords = lobj_Table.RecordsetClone
  Set lobj_Table = Nothing

End Function
This works great for MDB, MDE, and MDA files. Users can sort records, filter, and I always get the expected results.

However, this method doesn't work for ADP, ADE files. I get the original recordset as it was retrieved from the server.

So assume the user resorts the table in Access by clicking on the primary key column then selecting Records-Sort Descending (the records are now in reverse order). When I look at the recordset returned by the ActiveDatasheet, I do not get the newly sorted recordset. So when I see that the users first selection was row 1 and the selected count was 3, I get the first three records in the original table as stored on the server, which are now the last three records in the display. What I need is to get the first three records that are being displayed on the screen, the records that the user has actually selected.

Is there any object that will allow me to do this? Any clever workaround?