Link to home
Start Free TrialLog in
Avatar of Vasi04
Vasi04

asked on

Reading XML Data in VB6

I have an application. From application API I can define an interface to my VB DLL (for example: myDLL.myClass.myfunction)
From my application, I can select table and its columns to be used by myDLL
The data is exchanged in XML format.

I want to read this XML file/data using my function:  Public Function myFunction(sXML As String) As Variant
This function -
-  reads XML date for tablename, column ID and corresponding column data
-  can I assign XML data to a string variable in VB?

Can you help with sample code? I want to create DLL

--------------------------------
XML format:

<XML>
<DataCache USerid = "userid" username = "username">
<tablename1>
<columnname>colum value</columnname>
<columnname>colum value</columnname>
...
..
</tablename1>
<tablename2>
<columnname>colum value</columnname>
<columnname>colum value</columnname>
...
..
</tablename2>
...
..
</DataCache>
</XML>
-------------------------------
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Vasi04
Vasi04

ASKER

Thanks carl_tawn
Can I read individual field of a table and store it in a variable?
Can I delete fields and rows of a table and update value for a table to XML?
cheers
Both of those things are fairly simple.  Each node has a childNodes collection, so in the for each loop you can access the childnodes collection for the table and manipulate each element.

I would recommend heading to http://msdn.microsoft.com and downloading the XML SDK, it has a full reference for the XML Dom with worked examples in different languages.

Hope this helps.