Automatically get latest currency exchange rates into Access 97

I have been using this URL to get exchange rates from the web and get them into Access 97:

This gets me USD to CDN rates in a simple CSV file.

However, Yahoo just shut this down!!:

"It has come to our attention that this service is being used in violation of the Yahoo Terms of Service. As such, the service is being discontinued. For all future markets and equities data research, please refer to"

Does anyone know of another service that could work?
Russ :)
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewIT / Software Engineering ConsultantCommented:
How about this webservice, it returns results in JSON, but that wouldn't be hard to parse and load into Access table.

SOTAAuthor Commented:
I saw that, but I have no idea how to use it or parse it into a simple number like "1.2355" for USD to CAD.
Any help would be much appreciated!!!
Bill PrewIT / Software Engineering ConsultantCommented:
Parsing JSON can be a little tricky in VBA, a weakness there.

Not sure exactly how you are downloading and loading today, but the datasets can be downloaded too in CSV and XML formats, links on the page below.

Euro foreign exchange reference rates


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

See below on parsing JSON strings and inserting into Access tables.
SOTAAuthor Commented:
OK, using:

I get this saved as an *.ini file on my local drive:


Now, how can extract the "CAD":1.2767 so I can use that exchange rate?
Gustav BrockCIOCommented:
You can download the rates as a zipped csv for ECB:

Current reference rates CSV (zip)

This you can download using the function DownloadFile  found here:

Show pictures directly from URLs in Access forms and reports

and unzip using the function UnZip found here:

Zip and unzip files and folders with VBA the Windows Explorer way

Then you can simply link that table and read the exchange rates you need.

I notice you use Access 97! Though outdated, it should work anyway, but I haven't tested that.

Gustav BrockCIOCommented:
You can also use Json and the api mentioned by Bill.

Retrieve the Json modules from here: VBA.CVRAPI
and import these in your Access database.

Run the test function using this URL:

ServiceUrl = ""

Open in new window

in this function in module JsonTest:

' Call a Json service and return result as a collection and a messagebox.
Public Sub TestJsonService()

    Dim DataCollection      As Collection
    Dim ServiceUrl          As String
    Dim ResponseText        As String
    Dim UserAgent           As String
    Const Username          As String = "demo"
    Const App_id            As String = "b492b663ae3e458d9f0b042e8edb8c63"
    ' Register at
    'ServiceUrl = "" & Username
    ' Register at
    'ServiceUrl = "" & App_id
    'ServiceUrl = ""

    ' ECB Exchange Rates via
    ServiceUrl = ""

    UserAgent = "Example Org. - TestApp"
    If RetrieveDataResponse(ServiceUrl, ResponseText, UserAgent) = True Then
        Set DataCollection = CollectJson(ResponseText)
        MsgBox "Retrieved" & Str(DataCollection.Count) & " root member(s)", vbInformation + vbOKOnly, "Web Service Success"
    ElseIf ResponseText <> "" Then
        MsgBox ResponseText, vbCritical + vbOKOnly, "Web Service Error"
    End If
    Call ListFieldNames(DataCollection)
    Set DataCollection = Nothing
End Sub

Open in new window

Output will be:

    base                    USD
    date                    2017-11-07
        CAD                 1.2767

Open in new window

SOTAAuthor Commented:
From all these GREAT ideas...I got it to work!!!
After saving the JSON file locally, I open it and search for "CAD" using Mid+InStr:
    Open CompanyProfile("ClientDatabaseFolderPath") & "\ExchangeRate.ini" For Input As #1    'Open file for input.
    Input #1, GetExchangeRate  
    Close #1    ' Close file.
    GetExchangeRate = Mid(strTextLine, InStr(strTextLine, "TRY") + 5, 6)

Open in new window

SOTAAuthor Commented:
Thanks everyone!!!
SOTAAuthor Commented:
Oops my code should have been:
GetExchangeRate = Mid(strTextLine, InStr(strTextLine, "CAD") + 5, 6)
Gustav BrockCIOCommented:
Great! Though you shouldn't have to save the Json first as a file.

SOTAAuthor Commented:
Yes, good point Gustav!
I tried your code, but it does not work in Access 97.
There is no function "RetrieveDataResponse()" in Access 97.
SOTAAuthor Commented:
Sorry Gustav! I did not import the VBA into Access bad!
Will try again!
Gustav BrockCIOCommented:
Well, for a single tiny file, it won't make much of a difference ...

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.