|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
XML in VBI like to store an read data into an xml-file. The data which is used is a very simle List of persons: Name, surename name2, surname2 .... .... I don't want to use a db, so I decided to create XML. But I don't know how to create a simple XML and read from this XML. Any help? Thanks alot Ueli Werner
Show quote
Hide quote
"Ueli Werner" <u***@hotmail.com> wrote in message news:B65D37CF-CBE0-4C32-85F0-792CAD205BA6@microsoft.com... One way would be to use the Microsoft XML Core Services. This is an ActiveX component. There are several versions of it. v3.0 is > Hi there > > I like to store an read data into an xml-file. > > The data which is used is a very simle List of persons: > > Name, surename > name2, surname2 > ... > ... > > I don't want to use a db, so I decided to create XML. > > But I don't know how to create a simple XML and read from this XML. > > Any help? > included with Win2000 SP4 and later. v6.0 is the latest and is included with Vista and later, but may not exist on systems running XP/Server2003 or earlier. There is, however, a redistributable package you can install. Here's a link that describes the versions in more detail and has links to documentation: http://msdn.microsoft.com/en-us/xml/bb291077.aspx Also, since XML files are just text files, you could simply use VB's own file I/O for everything. Of course, you'd need to know a few specifics about the XML format. -- Mike "Ueli Werner" <u***@hotmail.com> wrote in message For simple tabular data like this there are lots of options. One of the news:B65D37CF-CBE0-4C32-85F0-792CAD205BA6@microsoft.com... > Hi there > > I like to store an read data into an xml-file. > > The data which is used is a very simle List of persons: > > Name, surename > name2, surname2 > ... > ... simplest in VB is to just use the regular Write#/Input# statements. These process CSV files in a special VB format that handles Date, Boolean, String, and various numeric types in a locale-neutral manner. The only caveat I have found is that for String values " characters are not automatically escaped. If you use Write# with a String value like: strVar = "Tom said ""Get lost!""" Write #intFile, strVar You'll have trouble reading it back because the file will contain: "Tom said "Get lost!"" One workaround might be to escape String quotes yourself, as in: strVar = "Tom said ""Get lost!""" Write #intFileOut, Replace$(strVar, """", vbTab) : Input #intFileIn, strVar: strVar = Replace$(strVar, vbTab, """") Aside from that minor glitch though this is a pretty simple way to deal with tabular data, and with a lot less overhead than any form of XML processing. Using vbTab is just one possibility and you could use vbFormFeed or any other character or substring you know will not occur in your String values as a " placeholder. "Bob Riemersma" <nospam@nil.net> wrote in message Write #? As far as I'm concerned, Write # is NEVER an option. Print #, yes.news:%23MIoYeo3JHA.4960@TK2MSFTNGP04.phx.gbl... > For simple tabular data like this there are lots of options. One of the > simplest in VB is to just use the regular Write#/Input# statements.
Help with a bit of maths
Create Icon File From Resource Anyone know of a good Help Authorizing Tool Changing a property on a control Vista and AutoRedraw Phone system integrated in vb app Sort UDT vs Database How do I stop opportunistic record locking from causing massive de calling (and deleting) a string from an unmanaged dll General Question on Deployment Stratagies |
|||||||||||||||||||||||