import media player playlist into Access

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hmph...

Well I guess I'm on my own on this one. ;)

What I'm doing is having Access append a table with a list of filenames from a directory that is currently explicitly defined in the code, but I'll have to work on that. This is what I've got so far:

Option Compare Database
    
    <FONT color=blue>Private <FONT color=blue>Sub </FONT></FONT>Form_Open(Cancel <FONT color=blue>As</FONT><FONT color=blue> Integer</FONT>)
    
    <FONT color=blue>Dim </FONT>dbs <FONT color=blue>As</FONT> DataBase
    <FONT color=blue>Dim </FONT>sql <FONT color=blue>As</FONT><FONT color=blue> String</FONT>
    <FONT color=blue>Dim </FONT>Filename <FONT color=blue>As</FONT><FONT color=blue> String</FONT>
    
     <FONT color=blue>Dim </FONT>myarray()
     <FONT color=blue>Dim </FONT>fs <FONT color=blue>As</FONT><FONT color=blue> Object</FONT>
     <FONT color=blue>Dim </FONT>i <FONT color=blue>As</FONT><FONT color=blue> Integer</FONT>
    
    <FONT color=blue>Set </FONT>dbs = CurrentDb
    
    <FONT color=#008000> ' Declare filesearch object.
</FONT>     <FONT color=blue>Set </FONT>fs = Application.FileSearch
    
    <FONT color=#008000> ' Set folder to search. This example assumes that the files reside
</FONT>    <FONT color=#008000> ' in the C:\Documents and Settings\a-fell\Desktop folder.
</FONT>     fs.LookIn = "C:\My Music\Wu\"
    
    <FONT color=#008000> ' Set file name to search for. This example assumes that you
</FONT>    <FONT color=#008000> ' want to search for .txt files.
</FONT>     fs.Filename = "*.mp3"
    
    <FONT color=#008000> ' Execute the file search, and check to see if the file(s) are
</FONT>    <FONT color=#008000> ' present.
</FONT>     <FONT color=blue>If </FONT>fs.Execute > 0 Then
    
    <FONT color=#008000> ' Redimension the array to the number of files found.
</FONT>     Re<FONT color=blue>Dim </FONT>myarray(fs.foundfiles.Count)
    
    <FONT color=#008000> ' Loop through all found file names and fill the array.
</FONT>     <FONT color=blue>For </FONT>i = 1 <FONT color=blue>To </FONT>fs.foundfiles.Count
     Filename = fs.foundfiles(i)
     sql = "Insert Into TblTrackInfo(TrackTitle) " & _
     "Values ('" & Filename & "')"
     dbs.Execute (sql)
     <FONT color=blue>Next</FONT> i
     <FONT color=blue>Else</FONT>
    
    <FONT color=#008000> ' Display message if no files were found.
</FONT>     MsgBox "No files were found"
     <FONT color=blue>End If</FONT>
    
    <FONT color=blue>End Sub</FONT>    

I think I can start to append the artists to a table by looking to the directory under which the group of songs is located.

BTW, the idea of this is a media database of my music, I know it seems redundant since media player does this, but I have over 10,000 (80 GB+) of titles, and Media Player, and Music Match, and RealPlayer, and RealOne have an absolutely horrible time dealing with this many records, so I need to make something of my own. I don't need to play anything from it (though that might not be too hard), just organize my tracks and track info.

Is there a way to retrieve the artist and album info from an .mp3 file?

As I think about it, I'm not sure the path will give me this info,

para ejample:
C:\My Music\MP3s\Wu\01. Gravel Pit.mp3

is on Album 'The W'

But this data is neither in the file details, or in the path, so where is it coming from?

As long as I keep my music organized like

C:\artist\album\song.mp3

I'm okay, but somehow all these media players are getting additional track details from something other than the online CDDB, since it works when I'm not online, or even if I add a CD and never go online, just manually type in the artist/album.

Thanks!

-Cort
 
Upvote 0
Howdy Cort, not sure if you saw the last two posts in the thread. Both an Excel version and an Access version.

I'm not going to write one for Word! :LOL:
 
Upvote 0

Forum statistics

Threads
1,221,525
Messages
6,160,327
Members
451,637
Latest member
hvp2262

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top