ImportXML method "Cannot establish connection to the server" error
My friend Peter, Access MVP, was recently puzzled by weird error, produced by simple line:
Application.ImportXML strPathFile, acStructureAndData
Runtime error was 31521 "Cannot establish connection to the server". There was no any network connection involved, strPathFile was as simple as "C:\Temp\Customer.xml". This xml file has been generated by:
Application.ExportXML acExportQuery, strQuery, _
strPathFile, , , , , acEmbedSchema
It turned out that Access Trust Center option "ActiveX Settings" was a source of such error, it was set to "Disable all controls without notification". Once it was changed to "Prompt me before enabling all controls …" – it works!
Thanks for sharing, Peter!
Labels: Access 2010, ActiveX