msxml3.dll Access Denied
Asked Answered
H

4

15

I have the following code:

Function filejson(json) 
  Dim objStream, strData 
  Set objStream = CreateObject("ADODB.Stream") 
  objStream.CharSet = "utf-8" 
  objStream.Open 
  objStream.LoadFromFile(json) 
  strData = objStream.ReadText() 
  filejson = strData 
End Function 
Function http2json(url) 
  Set http = CreateObject("Microsoft.XmlHttp") 
  http.open "GET", url, FALSE
  http.send ""                                   '<------- Line 13
  http2json=http.responseText 
End Function 
Function str2json(json,value) 
  Set scriptControl = CreateObject("MSScriptControl.ScriptControl") 
  scriptControl.Language = "JScript" 
  scriptControl.AddCode("x="& json & ";") 
  str2json= scriptControl.Eval( "x"& value ) 
End Function 
Function get_json_from_file(json,value) 
  get_json_from_file=str2json(filejson(json),value) 
End Function 
Function get_json_from_http(url,value) 
  get_json_from_http=str2json(http2json(url),value) 
End Function 
Function save_json_from_http(url,loc) 
  Set fso = CreateObject("Scripting.FileSystemObject") 
  fullpath = fso.GetAbsolutePathName(loc) 
  Dim objStream, strData 
  Set objStream = CreateObject("ADODB.Stream") 
  objStream.CharSet = "utf-8" 
  objStream.Open 
  objStream.WriteText http2json(url) 
  objStream.SaveToFile fullpath, 2 
  save_json_from_http=fullpath 
End Function
Wscript.Echo save_json_from_http("http://api.themoviedb.org/3/authentication/session/new?api_key=#####some_api_key_example#####&request_token=#####some_default_request_token######&_ctime_json_=1372670635.164760555","tmdb\temp\_tmdb_sock_w.164519518.2109")

When I run this code, I get the following error.

VBs msxml3.dll Error

If I remove &request_token=#####some_default_request_token###### it works just fine.

I also tried this: I added again the request_token, and I just typed a random character in it, for example, rexfuest_token, and strangely it worked. It seems there's a wrong parse in msxml3.dll. with request_token word.

Ideas?

Huey answered 1/7, 2013 at 9:42 Comment(0)
T
17

Try with a more recent version:

Set http = CreateObject("Msxml2.XMLHttp.6.0")

It could also be an issue with your Internet security settings (see here). Open the Internet Options applet in the Control Panel, select the zone for the website (probably "Trusted sites") in the Security tab and click Custom level….

Internet Options Security tab

In the section Miscellaneous set Access data sources across domains to Enabled.

Security Settings - Miscellaneous

Trachoma answered 1/7, 2013 at 11:2 Comment(3)
Same story access denied msxml6.dllHuey
Internet Options > Security tab > Custom level did the trick for me.Postfree
Same with me: access denied to msxml6.dll until I changed Custom level setting, then it worked.Mensch
W
25

This problem could be related to the security issues in Windows. The best way to fix it is to replace Microsoft.XmlHttp/MSXML2.XMLHTTP with MSXML2.ServerXMLHTTP.

I see the topic is almost 2 years old and most likely the topic starter has solved is issue. I have experienced the same issue couple hours ago and google provided me several links. There are some of them:

  1. https://social.msdn.microsoft.com/Forums/en-US/1abda1ce-e23c-4d0e-bccd-a323aa7f2ea5/access-is-denied-while-using-microsoftxmlhttp-to-get-a-url-link-in-vbscript-help?forum=xmlandnetfx
  2. https://support.webafrica.co.za/index.php?/Knowledgebase/Article/View/615/41/msxml3dll-error-80070005-access-is-denied---loading-xml-file
  3. http://www.experts-exchange.com/Programming/Languages/Scripting/ASP/Q_27305017.html
Wesleyanism answered 25/10, 2014 at 17:19 Comment(1)
Thanks a lot for this answer. I was trying to consume REST services from VFP using Microsoft.XmlHttp/MSXML2.XMLHTTP. POST and DELETE worked OK but PUT wouldn't; using MSXML2.ServerXMLHTTP was the solution, it works like a charm now.Hive
T
17

Try with a more recent version:

Set http = CreateObject("Msxml2.XMLHttp.6.0")

It could also be an issue with your Internet security settings (see here). Open the Internet Options applet in the Control Panel, select the zone for the website (probably "Trusted sites") in the Security tab and click Custom level….

Internet Options Security tab

In the section Miscellaneous set Access data sources across domains to Enabled.

Security Settings - Miscellaneous

Trachoma answered 1/7, 2013 at 11:2 Comment(3)
Same story access denied msxml6.dllHuey
Internet Options > Security tab > Custom level did the trick for me.Postfree
Same with me: access denied to msxml6.dll until I changed Custom level setting, then it worked.Mensch
S
2

Also can change URL from http to https. Me helps

Spondylitis answered 29/11, 2019 at 17:49 Comment(0)
S
0

For me the solution was to add the URL in trusted sites.

Internet explorer browser > Tools > Internet options > Security > Trusted sites > Sites > Add the URL under "Add this website to the zone: " and click add and save.

enter image description here

Sextillion answered 15/3, 2018 at 8:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.