Click here to Skip to main content
15,917,731 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

Does anyone know how to read the XML files from a location and once it has been loaded, need to make changes and then it has to be updated in the same location. If anyone has any idea, kindly help. Well I have read some articles but it does not suits to my scenario.

For your reference this is how I have set my source path and got the filenames in a combobox.
sourcepath = App.Path & "\xmlfiles\" & strVol & ".xml"

Looking forward for your replies, Thanks in advance.
Posted
Updated 5-Sep-11 18:52pm
v2

1 solution

Best way to achieve that is stop using VB6 and never return to it.

If by some weird reason you cannot do it, the right approach is using DOM interface. Parse XML into DOM, make all modifications on DOM and store DOM as XML file at the same location. The file will be opened and closed twice during this course of operations.

See this article explaining how to do it: http://www.techrepublic.com/article/creating-xml-documents-with-the-dom-in-vb6/1044759[^].

—SA
 
Share this answer
 
Comments
Wendelius 6-Sep-11 1:14am    
Exactly, my 5
Sergey Alexandrovich Kryukov 6-Sep-11 1:17am    
Thank you, Mika.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900