Results 1 to 10 of 10

Thread: XML to DB (or something else)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2002
    Location
    Campbell, OH USA
    Posts
    282

    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.

  2. #2
    Addicted Member
    Join Date
    Feb 2006
    Location
    Hyderabad, India
    Posts
    233

    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?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2002
    Location
    Campbell, OH USA
    Posts
    282

    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

  4. #4
    Addicted Member
    Join Date
    Feb 2006
    Location
    Hyderabad, India
    Posts
    233

    Re: XML to DB (or something else)


  5. #5
    Addicted Member
    Join Date
    Feb 2006
    Location
    Hyderabad, India
    Posts
    233

    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.

  6. #6
    Addicted Member
    Join Date
    Feb 2006
    Location
    Hyderabad, India
    Posts
    233

    Re: XML to DB (or something else)

    this one is closer to what you need .

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2002
    Location
    Campbell, OH USA
    Posts
    282

    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:
    1. <?xml version="1.0" encoding="iso-8859-1" ?>
    2. <smil>
    3.    <body>
    4.       <seq>
    5.          <monfolder src="F:\cdg\Karaoke Bay"/>
    6.          <media src="F:\cdg\Karaoke Bay\Amazed - Lonestar - Karaoke Bay.mp3">
    7.             <title value="Amazed"/>
    8.             <artist value="Lonestar"/>
    9.             <album value="Karaoke Bay"/>
    10.             <bpm value="000.00"/>
    11.             <gain value="00.00"/>
    12.             <duration value=" 0:04:37"/>
    13.             <version value="Karaoke Bay"/>
    14.             <Format value="2"/>
    15.             <bitrate value="096"/>
    16.             <id value="{BC868DF4-F784-4EEF-AB02-8D49C38EE7C1}"/>
    17.             <pos value="1"/>
    18.          </media>
    19.          <media src="F:\cdg\Karaoke Bay\Angels Among Us - Alabama - Karaoke Bay.mp3">
    20.             <title value="Angels Among Us"/>
    21.             <artist value="Alabama"/>
    22.             <album value="Karaoke Bay"/>
    23.             <bpm value="000.00"/>
    24.             <gain value="00.00"/>
    25.             <duration value=" 0:04:19"/>
    26.             <version value="Karaoke Bay"/>
    27.             <Format value="2"/>
    28.             <bitrate value="096"/>
    29.             <id value="{235DFF34-8D60-400F-862D-FA4ECA4BC92A}"/>
    30.             <pos value="2"/>
    31.          </media>
    32.       </seq>
    33.    </body>
    34. </smil>
    All i need from this id that artist, title and album. any suggestions

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    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.

  9. #9
    New Member
    Join Date
    Apr 2006
    Posts
    3

    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:
    1. Dim rsXML As New ADODB.Recordset
    2. Dim sXMLPath as String
    3.  
    4. sXMLPath = "C:\ABC.xml"
    5.  
    6. rsXML.Open sXMLPath
    7. [INDENT]MsgBox rsXML!title & vbCR & rsXML!artist & vbCr & rsXML!album[/INDENT]
    8. rsXML.Close
    9.  
    10. Set rsXML = Nothing

  10. #10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width