VB database sorting

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • qfchen
    New Member
    • Oct 2006
    • 91

    VB database sorting

    I have an employee database using microsoft access, In VB code, I need to sort through the database via Employee ID, The total employee record is about 8000, I sort from the first employee till the end. I feel the sorting time a bit longer, is there any way to shorten the sort time, Or shall I migrate the database to SQL? here is the code for sorting.

    For i = 0 To count - 1
    If employee.cardID = frmEmployee.Emp loyee_DataSet.E mployee.Rows(i) .Item (0) Then
    NameStr = frmEmployee.Emp loyee_DataSet.E mployee.Rows(i) .Item (2) 'first name
    DptStr = frmEmployee.Emp loyee_DataSet.E mployee.Rows(i) .Item (4) 'department
    found += 1
    goto foundOne
    End If
    Next
Working...