by hh_perth » Wed Apr 06, 2022 9:08 am
Although this topic may be outdated – I couldn’t find an answer anywhere else :
with a large database of songs I like to check / manipulate tags by applying VBA-EXCEL macros.
With SDB = CreateObject("SongsDB.SDBApplication") access works great in MM4
(with change SDB = CreateObject("SongsDB5.SDBApplication" unfortunately it does not work in MM5)
manipulating selected songs.
Problem: I want to check, whether a song “Artist – Title” already exists any how many (with what quality (bitrate) and length and where stored (path)).
With trying QuerySongs or OpenSQL both did not work properly, as a I was not able to formulate a direct search with
Artist & Title.
Set objSongListiterator = SDB.Database.QuerySongs("SongLength > 6*1000")
While Not objSongListiterator.EOF
Set objSongData = objSongListiterator.Item
If LCase(objSongData.artistname) = N_Artist And LCase(objSongData.title) = N_Title Then _
ActiveCell.Offset(i, 0) = objSongData.artistname: _
ActiveCell.Offset(i, 1) = objSongData.title: _
ActiveCell.Offset(i, 2) = objSongData.Path: _
ActiveCell.Offset(i, 3) = i & " of " & n: i = i + 1
objSongListiterator.Next
n = n + 1
Wend
Set objSongListiterator = Nothing
I was able to retrieve the requested information, but the macro needs to search the whole database.
There must be a better way – please help.
Although this topic may be outdated – I couldn’t find an answer anywhere else :
with a large database of songs I like to check / manipulate tags by applying VBA-EXCEL macros.
With SDB = CreateObject("SongsDB.SDBApplication") access works great in MM4
(with change SDB = CreateObject("SongsDB5.SDBApplication" unfortunately it does not work in MM5)
manipulating selected songs.
Problem: I want to check, whether a song “Artist – Title” already exists any how many (with what quality (bitrate) and length and where stored (path)).
With trying QuerySongs or OpenSQL both did not work properly, as a I was not able to formulate a direct search with
Artist & Title.
Set objSongListiterator = SDB.Database.QuerySongs("SongLength > 6*1000")
While Not objSongListiterator.EOF
Set objSongData = objSongListiterator.Item
If LCase(objSongData.artistname) = N_Artist And LCase(objSongData.title) = N_Title Then _
ActiveCell.Offset(i, 0) = objSongData.artistname: _
ActiveCell.Offset(i, 1) = objSongData.title: _
ActiveCell.Offset(i, 2) = objSongData.Path: _
ActiveCell.Offset(i, 3) = i & " of " & n: i = i + 1
objSongListiterator.Next
n = n + 1
Wend
Set objSongListiterator = Nothing
I was able to retrieve the requested information, but the macro needs to search the whole database.
There must be a better way – please help.