Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Sorting records
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
alpesh




PostPosted: Tue Jan 27, 2004 10:37 pm   Post subject: Sorting records

Sad Sad Sad Sad Sad Sad
Any body have any idea ...
how to sort record in database through VB

Embarassed Embarassed
Sponsor
Sponsor
Sponsor
sponsor
McKenzie




PostPosted: Tue Jan 27, 2004 10:57 pm   Post subject: (No subject)

1. Add ListBox, Data Contol, CommandButton
2. Attach Data control
3. Set ListBox sorted property to true
code:
Do While Not Data1.Recordset.EOF
    List1.AddItem Label1
    Data1.Recordset.MoveNext
Loop
Acid




PostPosted: Tue Jan 27, 2004 11:07 pm   Post subject: (No subject)

Well that's what I'd have suggested, if I knew just a little bit more about VB Wink
Tony




PostPosted: Tue Jan 27, 2004 11:33 pm   Post subject: (No subject)

or if you're accessing your database using DAO method (my personal preference over DB linked elements) you can just have sort=accending/deccending in your SQL statement.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
McKenzie




PostPosted: Wed Jan 28, 2004 12:05 am   Post subject: (No subject)

you can use DAO and ADO either way. MS is pushing ADO but DAO is still easier to start with.
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: