I am new to vbScript and working with a recordset of music file names. My program presents numbered and
sorted lists of files on the console, in panels of 55 items per page, anywhere from 60 to 17,000+ files
depending on program options chosen. The recordset is re-built when a different list is chosen,
for example, MP3-only, MIDI-only, both types, Favorites-only. The numbers added to the list are used to
identify the song file by providing the information needed to move to the DataList record to get the file name.
Here is sample code that creates the recordset:
Set DataList = CreateObject(“ADOR.Recordset”)
DataList.Fields.Append “Music File”, adVarChar, MaxCharacters
Do While Not objStream.AtEndOfStream
filename = objStream.ReadLine
DataList (“MusicFile”) = filename
The program has the option of saving a list of favorites, and they are stored in a text file of song file names: _Favorites.m3u
What I want to add is a + (plus mark) to the console list, in front of each song file that has been selected as a favorite.
So my question is: can my DataList recordset with an added favorites flag field be updated efficiently
each time the recordset is loaded, and can it be updated efficiently when favorites are removed from the favorites list.
Let’s say that the file “Zing.mp3” is one of the favorites. What is the best way to move to the record to update the flag field?
I can easily move to and update the field when adding a new favorite because I know the record position in the recordset.
When removing a favorite or re-building the DataList, updating the flag field at that time is the tricky part of this scheme.