MSXML Web Applications within MS Access (1 Viewer)

sixHat

Registered User.
Local time
Today, 00:24
Joined
Apr 28, 2012
Messages
46
Hello everyone... I have the need to to some https Twilio integration into MS Access some code examples would be great... but even more I want to learn how to implement any API into MS Access... in my research I came to the conclusion that this can only be accomplished via MSXML? Is this correct?
Is their other available libraries for creating manipulating html documents?

Also note that the application I would be creating it for is in MS Access 2002.

Lastly I don't see a clear tutorial on learning MSXML or custom web integration with MS Access so any books, sites or any available references would be greatly appreciated because I want an indepth understanding of how this works.... Thanks again!
 

sixHat

Registered User.
Local time
Today, 00:24
Joined
Apr 28, 2012
Messages
46
Yes... thanks I appreciate the link and the look out. I did come across this site in my research... I haven't looked the entire site over but from what I've seen in his downloadable module classes theirs really no documentation and really no comments so I can get a sense of MSXML. I'm sure I can play with it and eventually get what I'm now trying to do to work... but if at all possible I would really like to get a foundational understanding so I can freely create applications at will using this library.
 

jdraw

Super Moderator
Staff member
Local time
Today, 03:24
Joined
Jan 23, 2006
Messages
15,378
I did not find any specific examples.
However, here is a link that may be useful
http://msdn.microsoft.com/en-us/library/office/aa163921(v=office.10).aspx that I found on Google using "sample procedure vba using Msxml"

Here is an older link, and I think you may want to research DomDocument also.
http://msdn.microsoft.com/en-us/library/aa468547.aspx

Here is some code to get exchange rate from european central bank.

Code:
'---------------------------------------------------------------------------------------
' Procedure : LeeExchangeRateProc ..........  NO FORMS involved..............
' Author    : Jack
' Date      : 27-06-2012
' Purpose   : To get the daily exchange rates from the European Central Bank
'  at  http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml
' These currency/rate pairs show the value of 1 euro in this related currency on this date
'
' From a learning view, this is sending an XMLHTTP request and getting a Response and
' using the DOMDocument amd related objects to extract the required data
' from the xml response. This approach seems cleaner and more consistent than using
' vba functions to search and parse strings within the response.
'---------------------------------------------------------------------------------------

' Last Modified:
'
' Inputs: N/A
' Dependency:
' **********This requires a reference to Microsoft XML, v6.0 **************
'--------------------------------------------------------------------------
'
Sub LeeExchangeRateProc()
   Dim Resp As New DOMDocument
   Dim Req As New XMLHTTP
   Dim objNodeList As IXMLDOMNodeList
   Dim objNode As IXMLDOMNode
   Dim objAttribute As IXMLDOMAttribute
   Dim mCurrency As String
   Dim mRate As String
   Dim x As Integer
   On Error GoTo LeeExchangeRateProc_Error

   Req.Open "GET", "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml", False
   Req.send
   Resp.loadXML Req.responseText

  ' uncomment the next line to see the response
  ' Debug.Print "XML Response is " & vbCrLf & "~~~~~~~~~~~~~~~~~" & vbCrLf & Req.responseText
   x = Resp.getElementsByTagName("Cube").Length
   Debug.Print "The number of <Cube nodes is   " & x

   '
   '  Get all Cube nodes.
   '

   Set objNodeList = Resp.getElementsByTagName("Cube")

   '
   '  For each cube node if it has attributes currency and rate then display the values.
   ' One Cube row has no attributes and one has only a time attribute.
   '

   For Each objNode In objNodeList
       If (objNode.Attributes.Length > 0) Then
       ' Get the "time" attribute for the date to which these exchange rates apply
           Set objAttribute = objNode.Attributes.getNamedItem("time")
           If (Not objAttribute Is Nothing) Then
               Debug.Print "Exchange Rates from European Central Bank   as at  " & objAttribute.text & vbCrLf _
               & vbCrLf & "**Read these as 1 euro = **" & vbCrLf
           End If
        ' Get the "currency" attribute
           Set objAttribute = objNode.Attributes.getNamedItem("currency")
           If (Not objAttribute Is Nothing) Then
               mCurrency = objAttribute.text
           End If
        ' Get the associated "rate" attribute
           Set objAttribute = objNode.Attributes.getNamedItem("rate")
           If (Not objAttribute Is Nothing) Then
               mRate = objAttribute.text
           End If
        'Put the data in my variables for display
           If mCurrency > " " And mRate > " " Then
           Debug.Print mCurrency & "  " & mRate
           End If
       End If
   Next objNode

   On Error GoTo 0
   Exit Sub

LeeExchangeRateProc_Error:

    MsgBox "Error " & Err.number & " (" & Err.Description & ") in procedure LeeExchangeRateProc of Module xmlhttp_etc"

End Sub

Good luck with your project.
 

Users who are viewing this thread

Top Bottom