Sorting database tables via SQL

Results 1 to 2 of 2

Thread: Sorting database tables via SQL

  1. #1
    E.O. Guest

    Default Sorting database tables via SQL

    In MS Access:<BR>I&#039m trying to sort the contents of a recordset, then update the table so as to reflect the new, sorted status. However, when I sort the recordset and .update, the table is not sorted.<BR>I&#039d really rather not have to sort the recordset each time it&#039s read, since it updates from the database frequently enough that sorting would slow it way down.<BR><BR>Code:<BR>strSQL = "SELECT * FROM [Enrolled Students] ORDER BY LastName, FirstName"<BR>objRS.Open strSQL, DBConn, adOpenStatic, adLockOptimistic<BR>objRS.Update<BR>objRS.Close<BR >

  2. #2
    Ed Guest

    Default RE: Sorting database tables via SQL

    Once you use .Update, or use .AddNew, use .Requery to requery the recordset.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts