Results 1 to 6 of 6

Thread: XML Newbie needs advice

  1. #1
    wossname
    Guest

    XML Newbie needs advice

    I have just started dabbling in XML (about an hour ago in fact!) just a couple of questions to get me started...

    1. How easy is XML to use with VB? (Could you give a simple example?)

    2. Is it a viable alternative to databases (for small projects I mean (perhaps < 1000 records))?

    I've just been playing around with tags and the tree structure layout (I only have XML version 1 that comes with IE5). How do I upgrade to the latest version (v4.0?), will I need to upgrade IE?

    Adam.

  2. #2
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    350

    From one Newbie to another...

    Me offering XML/VB advice? That's a scary thought. Caveat Emptor

    Hi Adam,

    Attached is a simple VB/XML app I've been fiddling with. It's not for real, I've just been buggering around in fact.

    It uses a 'Purchases' transaction file with a simple XML structure which looks thusly:

    Code:
    [Purchases]
          [Purchase]
              [AccNo]...     [/AccNo]
              [SerialNo]... [/SerialNo]
              [Value]...     [/Value]
              [Date]...      [/Date]
          [/Purchase]
        .......... lots more transactions
    [/Purchases]

    But what it does is this:

    1) The Load button reads an XML file in and sticks the Account Numbers in a ListBox. It checks the XML is Kosher with ParseError and that the file has a 'Purchases' top tag. It checks that each AccNo only gets added to the list box once.

    2) The Show button dumps the XML into debug

    3) The Show Purchases button checks the ListBox for a selected AccNo, then puts all transactions for that AccNo into another ListBox.

    4) The Add Transaction button adds a transaction using the AccNo and Amount from 2 TextBoxes, and also adds the system date and increments the transaction serial number.

    I've put some comments in, and if you step thru' the code it should make sense. I'm not sure I've done it the easiest way... but for what it's worth, here it is! Your mileage may vary.
    Attached Files Attached Files
    Last edited by Jim Brown; Mar 25th, 2002 at 05:21 AM.

  3. #3
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    350

    MSDN up-to-date?

    btw Adam, is your MSDN up-to-date?

    There's a whole section on XML (including a tutorial, code snippets etc) in the October 2001 MSDN. Look under Platform SDK, Data Services.
    .

  4. #4
    wossname
    Guest
    I'm using the same version of MSDN that I got in the box with VB6 Pro upgrade a couple of years ago!

    What do you have to do to upgrade, order a CD or download a bunch of stuff?

    I'm running a bit tight on both money and HD space these days (more the former than the latter sadly).

  5. #5
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    350
    Originally posted by wossname


    What do you have to do to upgrade, order a CD or download a bunch of stuff?

    I'm not sure how we get ours. It would be a big download... it's 3x CDs now!
    .

  6. #6
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810
    MSDN Library is all on the web anyway, so if you want to get the latest articles do your searches at MSDN.Microsoft.com

    I have an article on my web site which helps explain the use of XML from VB....

    Hope this helps!
    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

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