Accessing the database from Excel

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderator: Gurus

Accessing the database from Excel

Postby Snyde » Sat May 21, 2016 12:41 pm

Hey, new guy here. Not even sure this is the right place to post this but here goes:

I would like to access the data in the database files from Excel so I can do some statistics work on the music that I listen to. Is there a way to do this so that, for example, when I change some metadata around, it automatically updates whatever I have on the Excel file?

Currently I am working with an excel file with one sheet as the extracted Excel report (default MM feature) but when I add items to the library manually and it's a pain in the ass. Other than accessing the database directly, is there a better way to do what I'm trying to do?

Thanks in advance.
Snyde
 
Posts: 1
Joined: Sat May 21, 2016 9:10 am

Re: Accessing the database from Excel

Postby mcow » Wed May 25, 2016 9:35 pm

Are you already scripting Excel? Do you use VB for that? If so, you can write scripts that will access MediaMonkey.

From Excel, the basic approach would be to scan all files periodically. That might be too slow. It might be possible to write a script that runs in MediaMonkey and exports the changes or at least exports the track ID that changes so that the Excel script can update it. But I haven't done anything with code that monitors database changes.
mcow
 
Posts: 813
Joined: Sun Sep 21, 2008 9:35 pm
Location: Cupertino, California

Re: Accessing the database from Excel

Postby MMuser2011 » Thu May 26, 2016 1:46 am

You could try to separate the data exported from MediaMonkey and your own data.
Add one worksheet with the data from MediaMonkey and one worksheet with your own informations.
Then associate an unique id from the first worksheet with a the same id in your own data.
Whenever you update the MediaMonkey export, your own data will not be touched.

In Excel you will find some formulas to identify which entries are new. Or you can use a "changed date" date to see, when and which entries has been modified.

This is just an idea, I can not send you a working Excel solution.
Magic Nodes v4.2 (2011-07-01) SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.3 (2011-07-06)
MMuser2011
 
Posts: 1182
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: Accessing the database from Excel

Postby rivorson » Sun May 29, 2016 5:13 am

The easy option would be to use the Custom Reports script that can be found in the forum. That will let you export much more data than the default report, including MM's database ID for each track. Then when you analyse that report in Excel you can simply check for IDs that aren't already in your main sheet to identify new tracks.
rivorson
 
Posts: 526
Joined: Thu Jul 25, 2013 4:17 am


Return to MediaMonkey 4 Addons developer forum

Who is online

Users browsing this forum: No registered users and 2 guests