After research and browsing i had found the solution on the net......
<html>
<head>
<title>Calling a webservice from classic ASP</title>
</head>
<body>
<%
Public Function fnXML2RecSet(ByVal sFileName As String) As Recordset
'ex: sFileName = "c:\test.xml"
'first we call msxml object for using xml files
'to make this we have to add referance from project->referances
'microsoft xml 3.0 to use this function
'so you msxml3.0 must be installed on the machine
Dim oDom As New MSXML2.DOMDocument
'we open a blank recordset
'to make this we have to again add referance
'microsoft activeX data objects 2.5
Dim rsReturn As New Recordset
'lets set async to false to use some ability of xml
oDom.async = False
'now load the file name which given to this function
oDom.Load (sFileName)
'look to the count of the fields
For i = 0 To oDom.documentElement.childNodes(0).childNodes.leng th - 1
'append each field name in to the recordset
'but we have to build information about the fields
'i used adVarChar, 300, adFldIsNullable as default action
'this means that all fields are varchar and contains 300 characters
'and can contain null value
'you may change this settings for your needs
'maybe you can detect type of the field etc..
rsReturn.Fields.Append oDom.documentElement.childNodes(0).childNodes(i).n odeName, adVarChar, 300, adFldIsNullable
Next
'now we have a recordset containing field names
'lets open this recordset
rsReturn.Open
'now lets look how many recordset are there in the xml file
For j = 0 To oDom.documentElement.childNodes.length - 1
'add a new record
rsReturn.AddNew
'put all values of the fields into the fieldnames matches
For i = 0 To oDom.documentElement.childNodes(j).childNodes.leng th - 1
rsReturn(oDom.documentElement.childNodes(j).childN odes(i).nodeName) = oDom.documentElement.childNodes(j).childNodes(i).T ext
Next
Next
'move to the first recordset
rsReturn.MoveFirst
'return this recordset as output
Set fnXML2RecSet = rsReturn
End Function
Private Sub btnTest_Click()
'lets call the class module as rsTest we builded
Dim rsTest As New XMLConverter
'lets open a new recordset
'we will use this recordset to show the output recordset generated from xml file
Dim rs As New Recordset
Dim sFileName As String
Dim sTmpStr As String
'lets set the file name
sFileName = App.Path & "\test.xml"
'now Set the recordset to the function
'which converts xml to recordset
'we give the name of the file
Set rs = rsTest.fnXML2RecSet(sFileName)
'lets loop this recordset until end of file
Do Until rs.EOF
sTmpStr = ""
'begin from the first recordname to the last recordname
For nX = 0 To rs.Fields.Count - 1
'add the name of the recordset field and value of it
sTmpStr = sTmpStr & rs.Fields.Item(nX).Name & " = " & rs.Fields.Item(nX).Value & vbCrLf
Next
'show it
MsgBox sTmpStr
'move to the next record
rs.MoveNext
Loop
End Sub
Public Function XMLDOMToRecordset(objXMLDOM As DOMDocument) As Recordset
Dim objRS As ADODB.Recordset
Set objRS = New ADODB.Recordset
objRS.Open objXMLDOM
Set RecordsetFromXMLDocument = objRS
Set objRS = Nothing
%>
<FORM method=POST name="form1">
Enter the two Values to be Added<BR>
<INPUT type="text" name="text1">
<INPUT type="text" name="text2">
<BR><BR>
<INPUT type="submit" value="Add" name="btnTest">
</form>
</body>
</html>
Second Reference :
<html>
<head>
<title>Calling a webservice from classic ASP</title>
</head>
<body>
<%
Private Function AddSlash(ByVal sPath As String) As String
sPath = Trim(sPath)
If Len(sPath) > 0 Then
If Right$(sPath, 1) <> "/" Then
If Right$(sPath, 1) <> "\" Then
sPath = sPath & "\"
End If
End If
AddSlash = sPath
End If
End Function
Private Sub CmdToRecordset_Click()
If File1.ListIndex = -1 Then
'must select an xml file, first
MsgBox "Please, select an Xml File, first!"
Exit Sub
End If
'else you can try loading Xml
Dim xmlDoc As DOMDocument
Dim Rs As ADODB.Recordset
Set xmlDoc = getXmlFromFile(AddSlash(File1.Path) & File1.FileName)
'function return nothing
'if error occurred in loading file
If Not xmlDoc Is Nothing Then
'now transform it in a recordset
'this function from Ms seems not to work
'at least for me: it says xml is not well formed...
' Set Rs = RecordsetFromXMLDocument(xmlDoc)
'let's do it manually
Set Rs = GetRsFromXmlManual(xmlDoc)
'got it!
'show records:
Dim CountCol As Long
Dim CountRow As Long
Dim rsFld As ADODB.Field
With grdFlex
.Redraw = False
.Cols = Rs.Fields.Count
.Rows = Rs.RecordCount + 1
.FixedRows = 1
'put columns titles
For Each rsFld In Rs.Fields
.TextMatrix(CountRow, CountCol) = rsFld.Name
CountCol = CountCol + 1
Next
'now put data
CountRow = 1
Do While Not Rs.EOF
CountCol = 0
For Each rsFld In Rs.Fields
'the trim( & "") will make null equal to empty string...
.TextMatrix(CountRow, CountCol) = Trim(rsFld.Value & "")
CountCol = CountCol + 1
Next
CountRow = CountRow + 1
Rs.MoveNext
Loop
'make grid refresh
.Redraw = True
End With
End If
End Sub
Private Sub Dir1_Change()
'sinc folder and files
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
'sinc drive and folders
'an error occur if drive is not ready
On Error GoTo errHandler
Dir1.Path = Drive1.Drive
Exit Sub
errHandler:
'last known working disk
'this could be done better...
Drive1.Drive = Left$(Dir1.Path, 1) & ":"
End Sub
Private Sub Form_Load()
'show only xml files
File1.Pattern = "*.xml"
End Sub
Private Function getXmlFromFile( _
ByVal sPathName As String _
) As DOMDocument
'Private xmlDoc As DOMDocument
'Private xmlId As IXMLDOMDocumentType
Dim xmlDoc As DOMDocument
Set xmlDoc = New DOMDocument
xmlDoc.async = False
'if you hold the xml in a variable,
'use loadXml
'if not xmlDoc.loadXML(sPathName) then
'...as below...
'If instead, as here, you're loading from file or
'from url, use load
If Not xmlDoc.Load(sPathName) Then
'the load or loadXml return false if something
'goes wrong
MsgBox xmlDoc.parseError.reason 'here you hold an err.description
Set xmlDoc = Nothing
End If
Set getXmlFromFile = xmlDoc
End Function
''seems as if following does not work...
'Private Function RecordsetFromXMLDocument(ByVal XMLDOMDocument As DOMDocument) As ADODB.Recordset
' Dim Rs As ADODB.Recordset
'
' 'this is from Msdn:
' 'HOWTO: Obtain an ADO Recordset from XML
'
' Set Rs = New ADODB.Recordset
' Rs.Open XMLDOMDocument 'pass the DOM Document instance as the Source argument
'
' Set RecordsetFromXMLDocument = Rs 'return the recordset
' Set Rs = Nothing
'End Function
Private Function GetRsFromXmlManual(ByVal xmlDoc As DOMDocument) As ADODB.Recordset
'Original routine is from Planet-Source-Code.com
'at http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=7190&lngWId=4
'I added a more complex way to be sure to append all the fields needed...
Dim CountField As Long
Dim CountRecord As Long
Dim Rs As ADODB.Recordset
Dim dicFields As Scripting.Dictionary
Dim sFieldName As String
Set Rs = New ADODB.Recordset
Set dicFields = New Scripting.Dictionary
'To be sure to get all fields you need, scroll all
'and add new names to a dictionary and to recordset - choosed
'dictionary as it has a method to test for a key
'existence without making you need error handling
For CountRecord = 0 To xmlDoc.documentElement.childNodes.length - 1
'get name of field
For CountField = 0 To xmlDoc.documentElement.childNodes(CountRecord).chi ldNodes.length - 1
sFieldName = xmlDoc.documentElement.childNodes(CountRecord).chi ldNodes(CountField).nodeName
If Not dicFields.Exists(sFieldName) Then
'a non already added field name
dicFields.Add sFieldName, sFieldName
Rs.Fields.Append sFieldName, adVarChar, 300, adFldIsNullable
End If
Next
Next
'now recordset has all required fields
Rs.Open
'now lets look how many recordset are there in the xml file
For CountRecord = 0 To xmlDoc.documentElement.childNodes.length - 1
'add a new record
Rs.AddNew
'put all values of the fields into the fieldnames matches
For CountField = 0 To xmlDoc.documentElement.childNodes(CountRecord).chi ldNodes.length - 1
sFieldName = xmlDoc.documentElement.childNodes(CountRecord).chi ldNodes(CountField).nodeName
Rs(sFieldName) = xmlDoc.documentElement.childNodes(CountRecord).chi ldNodes(CountField).Text
Next
Next
'move first
Rs.MoveFirst
Set GetRsFromXmlManual = Rs
Set Rs = Nothing
End Function
%>
<FORM method=POST name="form1">
Enter the two Values to be Added<BR>
<INPUT type="text" name="text1">
<INPUT type="text" name="text2">
<BR><BR>
<INPUT type="submit" value="Add" name="submit1" >
</form>
</body>
</html>
just refer to the above methods for the solution
Hope this is helpful