Discussion Locked

MS VB 6.0 Testing DataList Missing recs

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am learning how to use a datalist function in Visual Basic 6.0. I successfully connected to a MS Access database and displayed data. My problem is that I noticed the sequence of the items listed is not ascending. The MS Access DB (MS2000 ver 9.0) has a primary key for the field listed. Is it possible to have the datalist item ascend as the records do in the Access Database?

4 replies

by sl-campbell

How are you setting the DataSource?
The recordset object of the data source can have an ORDER BY clause. If you are using a DC then set the RecordSource property to a SQL Query statement:

dc1.RecordSource = "SELECT * FROM myTable ORDER BY myField"

If you still cannot get it then check out the sample applications installed with VB.

Post a Comment to your question if you need more help and I will get back to you.

by mippps

This was exactly my problem. Thanks for helping a guy trying not to fall of the turnip truck. With no one to be mentored by pulling yourself up by you bootstraps is tough. Thanks

by mippps

I accidently close the question without rewarding points to the person who answered it correctly. I will learn how to do this correctly next time. Sorry for being so inept.

This discussion is closed to new replies.