SDB.Database.OpenSQL Interator Issue

Post a reply

:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review

Expand view Topic review: SDB.Database.OpenSQL Interator Issue

Re: SDB.Database.OpenSQL Interator Issue

by MyVikes » Wed May 19, 2021 4:18 am

after taking a closer look at the Reference Manager i see i have added a MM5 specific library. these are the references i have in the project now:
"MediaMonkey Library" and "MediaMonkey Library" 5"
so maybe i added that and forgot. :D

Re: SDB.Database.OpenSQL Interator Issue

by MyVikes » Wed May 19, 2021 4:11 am

I have had it working with MM4 following the instructions here ... plications and i did nothing specific to MM5 except to change "SongsDB.SDBApplication" to "SongsDB5.SDBApplication" and it continues to work. This has been working well with MM4 for quite some time and except for the glitch with the iterator (purpose of the original post here) seems to work fine with MM5.

Did you have it working with MM4?

Re: SDB.Database.OpenSQL Interator Issue

by bensynnock » Tue May 18, 2021 6:54 am

I couldn't get the MM5 com object to work at all in (using visual studio 2019). I assume you got it to work, but how is yours set up?

I'd like to get it working, because otherwise I'll have to rewrite my apps, but maybe this is the push I need to get me to learn javascript.

Re: SDB.Database.OpenSQL Interator Issue

by MyVikes » Mon May 17, 2021 5:19 pm

The databaseIterator has changed. It now returns a JSON array see here:

"data":[{"ID":"222", "ARTIST":"B.B. King", "ALBUM":"One Kind Favor", "YEAR":"20080000", "COMMENT":"", "TRACKS":"12", "YEAR":"20080000",...................

So i know the "fix". Basically convert the string to to array of json objects, loop on that....but i have several of these that have broken due to a change in what the databaseIterator is in MM5 versus what it was in MM4 (see here: ).

According to the document here, ... plications, it says "The SDBApplication class is largely unchanged from MediaMonkey 4...". So was the change intentional or unintentional? IF unintentional will it be corrected but if intentional than that statement needs to be updated in my app.

BTW...i've developed my own Android app that interacts with MM4 via a set of RESTful web services written in VB.Net which communicate with MM4 via COM. All very customized to how i listen to my rather expansive music collection. What I'm working to do now is to replace the web services with direct calls from the Android app to MM5 via web sockets and i'm making good progress but this is going to make me some time to do still.

Re: SDB.Database.OpenSQL Interator Issue

by bensynnock » Mon May 17, 2021 1:46 pm

What happens if you change this code:

Console.WriteLine("databaseIterator:" & databaseIterator.ToString)


Console.WriteLine("databaseIterator:" & databaseIterator)


Can you verify that databaseIterator is the type of object that you think it is? The error message "Public member 'EOF' on type 'String' not found" implies that the object in question is of type 'String'.

Re: SDB.Database.OpenSQL Interator Issue

by MyVikes » Mon May 17, 2021 11:43 am

I did not post the full code...there is a close to the while loop. The issue is at the ".EOF" on the databaseIterator. It worked fine with MM4 but breaks with MM5 giving a "String' not found." error.

Re: SDB.Database.OpenSQL Interator Issue

by Peke » Mon May 17, 2021 11:22 am

Looks like code is incomplete eg missing ) to close new album or I am missing something?

SDB.Database.OpenSQL Interator Issue

by MyVikes » Mon May 17, 2021 4:10 am

I get an error ("Exception:System.MissingMemberException: Public member 'EOF' on type 'String' not found.") on the While loop in MM5 and it works fine in MM4 using COM. Using a Console statement i can see i get an array of objects:

Code: Select all

Dim databaseIterator As Object

            SDB = CreateObject(ProgId)

            databaseIterator = SDB.Database.OpenSQL(sqlString)

            Console.WriteLine("databaseIterator:" & databaseIterator.ToString)

            While Not databaseIterator.EOF
                    New Album(
Any suggestions what (or why it) might have changed as I thought it was supposed to be transparent?