XML to DB (or something else)
Hey All...
Here is my issue. I am using a program called PCDJ RED VRM. when you add files in the library, it saves all the info about the files in XML files. I have already written server/client program thatthe server side reads in a list of titles and artists (normally in ASCII) and parses a mini db that houses the information and allows the client to access that info to allows users to request songs. What i am trying to do is have the server automatically read in the XML files from the PCDJ and make the mini db from those every time it is loaded. but i have no clue about XML files. XML is great but since i have had no need for it, i never learned it. What i really need is a source code for a conversion algorithem (i can't spell, i am a programmer...lol) to convert the data from the XML's into MDB's. then i can just combine all the DB's into the mini db i am using now. even if there is a component that i can embed into the proggy, that will do. Thanks in advanced to those who can help.
Re: XML to DB (or something else)
I don't know much about xml. But there is a library Microsoft XML. The IDE I have shows 3 or 4 versions of it. It has appropriate classes and methods. I have never used it, so I can't tell you how to use it. DOMDOCUMENT, load, etc, are the classes and methods. Trial and error making use of the object library should get you going. Did you search the forum for it?
Re: XML to DB (or something else)
i did a search for xml to DB and all i found was a seperate program that would not interface with my VB code and the person wouldnot release the source so i am screwed there. never used xml dom
Re: XML to DB (or something else)
Re: XML to DB (or something else)
here is another link. This does the opposite of what you need i.e. creating xmk from database.
Re: XML to DB (or something else)
this one is closer to what you need .
Re: XML to DB (or something else)
i tried all those links and none of them seem to have what i need. here is an example of the xml:
VB Code:
<?xml version="1.0" encoding="iso-8859-1" ?>
<smil>
<body>
<seq>
<monfolder src="F:\cdg\Karaoke Bay"/>
<media src="F:\cdg\Karaoke Bay\Amazed - Lonestar - Karaoke Bay.mp3">
<title value="Amazed"/>
<artist value="Lonestar"/>
<album value="Karaoke Bay"/>
<bpm value="000.00"/>
<gain value="00.00"/>
<duration value=" 0:04:37"/>
<version value="Karaoke Bay"/>
<Format value="2"/>
<bitrate value="096"/>
<id value="{BC868DF4-F784-4EEF-AB02-8D49C38EE7C1}"/>
<pos value="1"/>
</media>
<media src="F:\cdg\Karaoke Bay\Angels Among Us - Alabama - Karaoke Bay.mp3">
<title value="Angels Among Us"/>
<artist value="Alabama"/>
<album value="Karaoke Bay"/>
<bpm value="000.00"/>
<gain value="00.00"/>
<duration value=" 0:04:19"/>
<version value="Karaoke Bay"/>
<Format value="2"/>
<bitrate value="096"/>
<id value="{235DFF34-8D60-400F-862D-FA4ECA4BC92A}"/>
<pos value="2"/>
</media>
</seq>
</body>
</smil>
All i need from this id that artist, title and album. any suggestions
Re: XML to DB (or something else)
Build your own xml parser if you have to, although the tree view control seems to make it a bit easier. (It's one thing I want to learn but haven't yet.)
Look on Planet Source Code for xml in their VB area. There's a program that's basically a code safe that uses xml, and should have enough for you to learn how to read that file and get the values from the nodes you need.
Re: XML to DB (or something else)
Hi!
In VB u can very easily handle XMLs in both ways, creating and storing data in a XML andreading data from a XML. ADO's recordset object provides u both of the features. U can open any XML in a recordset as anyother datasource of DBs. And when u get open that XML, it behaves exactly as a recordset, u can read write data from that XML.
Here is a sample code to open and read data from a XML.
VB Code:
Dim rsXML As New ADODB.Recordset
Dim sXMLPath as String
sXMLPath = "C:\ABC.xml"
rsXML.Open sXMLPath
[INDENT]MsgBox rsXML!title & vbCR & rsXML!artist & vbCr & rsXML!album[/INDENT]
rsXML.Close
Set rsXML = Nothing
1 Attachment(s)
Re: XML to DB (or something else)
Here is a very simple example that uses xml. If you search this forum for xml I'm sure you'll find many other examples.