Discussion Locked

Creating XML documents using VB

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi everyone,

My name is Derek. I want to create an XML doc using VB. The contents of the XML should be based on a specified database. Currently I use the following methods
(conn.open "filedsn=cust"
charRS.open "select * from Customer", conn, adOpenForwardOnly, adLockReadOnly, -1
Set rdataXML = New DOMDocument
charRS.save "C:\testxml2.xml", adPersistXML)

This doesn't really help me coz I have problem binding the XML in my HTML file even when i use the binding tag like
.

Is there anything wrong with my code or even better please suggest how I can write a better VB code to get data from a db and then construct an XML doc

Contact me at dwtk9@yahoo.com if there's any prob. Thanks!!!!

4 replies

by brianharris

The XML output from ADO is funky.

We wrote a custom methods that you could pass in a recordset and would return an XML Document. While I don't want to post a lot of code, it really wasn't too hard. The performance isn't great if you retrieve a lot of data but its passable.

Basically, write a method that accepts a Recordset and then loops through the Records and Fields and appends them to an XML Document either as nodes or attributes. I think we might have had 20-30 lines of code to do this.

Good luck!

by dwtk9

Sorry but my colleagues helped me out on this already. I'm posting a new question.

by dwtk9

Hi All,
Sorry but I'm kinda of new to this programming stuff it would be great if you could e-mail me some sample codes with clear explanation. thanks

This discussion is closed to new replies.