Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
| Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 14th, 2008, 02:19 PM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Folder deletion with XML Config

Hi,

I know that this may have been asked over and over but I cant seem to get anywhere and I'm running out of time to sort this out. Basically, I need an application that can read an XML config file with PC names in and folder locations and progressivley go through and delete folders older than 30 days in said locations. This needs to be in VB6 and I just dont know where to start or for that matter actually code it.

Can anyone help me or point me in the right direction please?

  #2 (permalink)  
Old January 14th, 2008, 06:49 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I'm guessing here, but I would suspect that with VB6 you will essentially need to "teach VB to read." Read the file a character or a line at a time, and wade into what you find. When you encounter a < increment a "level" counter. Search for the various properties that that node can have, and so on. You can read a text file just like any other text file. (I recommend using the File Sustem Object "Microsoft Windows Scripting Runtime" in the references dialog.)

It sounds like your xml file will be fairly restricted in format, so you don't really need to make a full-fledged xml interpreter. Just take it a step at a time. make a list of what you think you will encounter, and write code to handle that.
  #3 (permalink)  
Old January 14th, 2008, 08:36 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

There is the DOM object if you insert msxml into your project.. and you can just have a nodelist to search...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
  #4 (permalink)  
Old January 15th, 2008, 07:15 PM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

bizzarley through some reverse engineering I have done it. I have never written any vb code especially 6 as i have only ever learnt c# so it was a bit alien to me. I have done it now though.

Thanks for the comments though

  #5 (permalink)  
Old January 16th, 2008, 04:57 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Gonzalo,

    I was unaware of that library. It looks pretty robust; thanks for bringing it up.

For those lurking, I found the following in the Refferences dialog:
  • Microsoft XML, version 2.0 (MSXML.DLL)
  • Microsoft XML, v2.6 (msxml2.dll)
  • Microsoft XML, v3.0 (msxml3.dll)
  • Microsoft XML, v4.0 (msxml4.dll)
  • Microsoft XML, v6.0 (msxml6.dll)
  #6 (permalink)  
Old January 16th, 2008, 08:11 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

the only thing you have to watch if when you need to deploy them. They are deployed by versions of IE and several windows patch, so not all system have all of them... Also there is a weird system to register them.. but I never had a problem using them (in fact, I could imagine that they took the xml parser inside .net from one of this libraries...)

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML Config reader V1taminC XML 1 March 11th, 2008 09:11 AM
process all xml files in folder lsantos2000 XSLT 4 November 8th, 2007 01:41 PM
hi please help me on xml deletion karthikc85 XML 1 October 10th, 2006 06:09 AM
Deletion.. ankur_icfai SQL Server 2000 8 August 30th, 2006 07:31 AM
Read XML Config File From Within EJB JAR leojhartiv J2EE 0 October 6th, 2003 03:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.