You should be able to add a reference to your vb project called Microsoft XML, v3.0 - (it might not be that exact version)
Once you do that you can do all kinds of xml parsing or whatever - We have code like this:
Public Sub ReadXMLStartupInfo(strLocalFileName As String)
Dim objXMLDoc As New MSXML2.DOMDocument
Dim objXMLDomNode As MSXML2.IXMLDOMNode
Dim i As Integer
Dim j As Integer
Dim a As String
Dim strErrMessage As String
Dim bRet As Boolean
On Error GoTo Err
i = InStr(strLocalFileName, "/XML=")
If i = 0 Then
strErrMessage = "No XML File Specified, Contact IT Support"
GoTo Err
End If
j = InStr(i + 1, strLocalFileName, "/")
If j > 0 Then
a = Mid$(strLocalFileName, i + 5, j - (i + 5))
Else
a = Mid$(strLocalFileName, i + 5, Len(strLocalFileName) - i)
End If
objXMLDoc.async = False
bRet = objXMLDoc.Load(App.Path & "\" & a)
If bRet <> True Then
strErrMessage = "XML File NOT Found" & vbCrLf & App.Path & "\" & strLocalFileName
GoTo Err
End If
If objXMLDoc.parseError.errorCode <> 0 Then
strErrMessage = "XML Settings not present or not valid."
GoTo Err
End If
Set objXMLDomNode = objXMLDoc.selectSingleNode("/Settings/Server")
If objXMLDomNode Is Nothing Then
strErrMessage = "SERVER Setting NOT Present in Startup file."
GoTo Err
Else
strServer = objXMLDomNode.Text
End If
Set objXMLDomNode = objXMLDoc.selectSingleNode("/Settings/Database")
If objXMLDomNode Is Nothing Then
strErrMessage = "DATABASE Setting NOT Present in Startup file."
GoTo Err
Else
strDatabase = objXMLDomNode.Text
End If
Set objXMLDomNode = objXMLDoc.selectSingleNode("/Settings/PaymentsServer")
If objXMLDomNode Is Nothing Then
strErrMessage = "PAYMENTS SERVER NOT Present in Startup file."
GoTo Err
Else
strPaymentsServer = objXMLDomNode.Text
End If
Exit Sub
Err:
Call MsgBox("Problem with ReadXMLStartupInfo" & vbNewLine & vbNewLine & vbNewLine _
& "Error Source = " & Err.Source & vbNewLine _
& "Error Description = " & Err.Description & vbNewLine _
& "Error Number = " & Err.Number & vbNewLine & vbNewLine _
& "SQL Text = " & strErrMessage)
Screen.MousePointer = vbDefault
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.