[AccessD] Exchange Rate - Currency Converter thingy

Gustav Brock gustav at cactus.dk
Fri Jun 29 06:27:09 CDT 2012


Hi Shamil

No no. By the phrasing:

> next step would be to just download the xml-string and parse it.

I just meant to fetch the file content without using the XML library and then parse it (the same way as you demonstrated or similar).

As to your project, I guess the API method would be marginally faster for fetching small files and few values - but very inflexible. 

/gustav


>>> mcp2004 at mail.ru 29-06-12 12:23 >>>
Hi Gustav --

OK. But

Dim uri As String
uri = "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"
Dim xmlDoc As New MSXML2.DOMDocument30
xmlDoc.async = False
xmlDoc.Load (uri)

does download XML file from the source URI.

You did also noted on parsing but "naive-hardcoder approach" sample does use parsing:

Dim xml As String
xml = xmlDoc.DocumentElement.xml
Dim pos1 As Integer
Dim pos2 As Integer
Dim currencyCode As String
currencyCode = "RUB"
pos1 = InStr(xml, "currency=""" + currencyCode)
pos1 = InStr(pos1, xml, "rate=""")
pos1 = InStr(pos1 + 1, xml, """")
pos2 = InStr(pos1 + 1, xml, """")
Dim currencyRate As String
currencyRate = Mid(xml, pos1 + 1, pos2 - pos1 - 1)

What other parsing technique did you mean?

I'm a kind of starting collecting different approaches/techniques to solve the same tasks as a way to investigate modern application software development *technologies, their applicability for effective solutions of real life tasks in different contexts, their advantages and limitations, their flexibility to be adapted to ever changing requirements etc. More on that is planned here to be posted in dba-VB if free-time allows...

Thank you.

-- Shamil



More information about the AccessD mailing list