Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hi all
please help.
how do we open a .xml file using vb6?
i need to grab some data from the file and print it.regards
Athlon 64 2800+ @ 2.63 Ghz Stock Cooling
Timings:2-3-2-5
V-Gen 512MB pc3200
DFI Lanparty UT NF3
Abit R9550 VGuru XTurbo
525Mhz/300Mhz

An XML file is a specially formatted text file. You open it like any other text file. You then read and parse the data until you find the data label(s) containing the desired data elements. Then extract the required elements and format and print it. You will need to find the XML data layout for the type of XML file you are reading.

I might be able to find my XML dll that I created in VB6...let me look and I will post it if I find it.
Chi
They mostly come at night...mostly.

You can get my source code as well as the compiled DLL here:
http://www.evolutionsoftwarellc.com/downloads/XML.rar
Enjoy
ChiThey mostly come at night...mostly.

wow, thanx chi.
i have downloaded it, but when i run it, there is a message box "compile error, cannot find project or library". then, i manually browse for .dll file, but it still happens. hmm, what am i missing here?
fred, how do we find the data layout?Athlon 64 2800+ @ 2.63 Ghz Stock Cooling
Timings:2-3-2-5
V-Gen 512MB pc3200
DFI Lanparty UT NF3
Abit R9550 VGuru XTurbo
525Mhz/300Mhz

Accompanying an XML file is a DTD (Data Type Definition) file. I think you could make a DLL like chi that reads The DTD so that it could then extract the data from the XML. In my case I just found the labels that I wanted and extracted the data directly. The writer or specifier of the XML will usually post the DTD somewhere near the programming of the original application. A long way to find the fields is to read the XML file to find the structure of it. Note that you can have repeated records in a file as well as repeated fields in an a record. You may have records without certain fields. Essentially you might consider an XML file as a form of database. In my case it was a 17MB XML file from which I extracted 216 database files containing slightly more than 29,000 records I wanted.
In your case you may be looking at an XML file that has only one record. Look at the file and inspect it. That should determine your plan of attack. I am probably using a more primitive method (compiled BASIC in a DOS Window). It gets the job done on resource limited machines.

you need to either register the dll via regsvr32.exe or add the project to your current vb project.
Chi
They mostly come at night...mostly.

hmm, come to think of it, i will use C/CPP to read it, and VB as the interface, it will be a lot easier, thanx fred.
i have created a simple program to read the xml, and it is easier for me to make a C program to read an XML file and extract the data i wanted.
i have another question, but it is OOT, so i will post it on different subject.
Athlon 64 2800+ @ 2.63 Ghz Stock Cooling
Timings:2-3-2-5
V-Gen 512MB pc3200
DFI Lanparty UT NF3
Abit R9550 VGuru XTurbo
525Mhz/300Mhz

Hello to all,
I Am in need of source code in VB of reading selected data from XML file located in some URL .So kindly hlp me to get out of this

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |