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>
-------------------------- -----
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
ASKER
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