Results 1 to 3 of 3

Thread: Recordset.Sort

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Question Recordset.Sort

    How useful is this ? Recordset.Sort

  2. #2
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    If it's ADO j4u then heres an example...if you didn't know about it already that is...

    Code:
    'BeginSortVB
    Public Sub SortX()
    Dim cnn As New ADODB.Connection
    Dim rst As New ADODB.Recordset
    
    rst.CursorLocation = adUseClient
    cnn.Open "DSN=Pubs;Provider=MSDASQL;uid=sa;pwd=;"
    rst.Open "SELECT * FROM Authors", cnn, _
             adOpenStatic, adLockReadOnly, adCmdText
    SortXprint "Initial Order", rst
    
    rst.Sort = "au_lname ASC, au_fname ASC"
    SortXprint "Last Name Ascending", rst
    
    rst.Sort = "au_lname DESC, au_fname ASC"
    SortXprint "Last Name Descending", rst
    
    rst.Close
    cnn.Close
    End Sub
    'EndSortVB
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    thanks I was using it today and I was just thinking WOW this can be useful in some situations!

Posting Permissions

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



Click Here to Expand Forum to Full Width