"The login request was denied" Access 2003 XMLHTTP under Windows XP

Posted on 2011-05-11
Last Modified: 2012-05-11
When running some VB on a windows XP machine running Access 2003, I get the following error:

Runtime error ‘-2147012881 (80072eef)’:

The login request was denied.

Open in new window

when the script reaches the xmlhttp.send command.  The command is as follows:
xmlhttp.Open "POST", "", False, "username", "secret"

Open in new window

This works in Windows vista 32/64 bit, Windows 7 32/64 bit, and in Access 2003/2007/2010 in Vista/Windows 7.  The only OS it does not work in under any version of Access is XP.

Any ideas?
Question by:lorsungcu
    LVL 22

    Expert Comment

    by:Nico Bontenbal
    Could it be Vista and 7 have a newer version of the XMLHTTP?
    LVL 2

    Author Comment

    I have checked,  and they all have the latest version.  I have a feeling its not sending the login/password formatted correctly, but i dont know how to test for that.  I dont have access to the logs on the remote webserver.
    LVL 22

    Expert Comment

    by:Nico Bontenbal
    Well, sorry, I don't have any other suggestions then.
    LVL 2

    Accepted Solution

    I fixed this by re-writing the auth portion of the code from this:

    Set objSvrHTTP = New ServerXMLHTTP
    objSvrHTTP.Open "POST", "https://urlhere", False, "username", "secret"
    objSvrHTTP.setRequestHeader "Accept", "application/xml"
    objSvrHTTP.setRequestHeader "Content-Type", "application/xml"

    Open in new window

    to this:

    Set swvxRequest = New MSXML2.XMLHTTP
    With swvxRequest
        .Open "POST", "https://urlhere", False, "username", "secret"
        .setRequestHeader "Accept", "application/xml"
        .setRequestHeader "Content-Type", "application/xml"
        .send (xml)
    End With

    Open in new window

    Now works in windows 7 32/64bit, Vista 32/64bit and XP 32/64bit.
    LVL 2

    Author Closing Comment

    Figured it out myself.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now