Hello all, I am using Access VBA to access movies information using the API, it is working fine but i have a problem with attributes in the JSON that have as name the word "name" which is a reserved word.
let's say i want to access the production companies, i am using this code, it is working fine if i want to get the id, but it doesn't work if i am trying to get the names because the word "name" is a reserved word, does anyone have an idea how to fix it?
Thank you
this code is working fine: Set Keys1 = VBA.CallByName(jsonDecode1, "production_companies", VbGet)
movie_companies = ""
For Each Key In Keys1
movie_companies = movie_companies & Key.id & ","
Next
this code is not working: Set Keys1 = VBA.CallByName(jsonDecode1, "production_companies", VbGet)
movie_companies = ""
For Each Key In Keys1
movie_companies = movie_companies & **Key.Name** & ","
Next
this is the json:
production_companies: [ { name: "France 2 Cinéma", id: 83 }, { name: "SBS Productions", id: 8997 }, { name: "Les Films Français", id: 16782 } ],
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by Travis Bell
on October 4, 2017 at 10:53 PM
Hi @neji_mehrez,
Unless someone familiar with Access happens to stumble on this post, you probably won't get much action here (I am not familiar with it). For language specific issues I usually suggest posting over at something like Stack Overflow.
Reply by neji_mehrez
on October 4, 2017 at 10:55 PM
I will, thank you for your help :)
Reply by RSquared64
on January 29, 2018 at 4:14 AM
Hi @neji_mehrez
I am in the process of doing exactly what you are talking about.
Any possible way we could communicate and/or share code?