Solved

Sharepoint 2010: xmlhttp PUT in VBA denied with valid credentials

Posted on 2011-02-22
8
1,282 Views
Last Modified: 2012-06-27
In an Access application the following VBA instructions return error 401 (Unauthorized) where UserName and pw represent valid credentials:
...
xmlhttp.Open "PUT", sharepointFileName, False, UserName, pw
xmlhttp.Send sBody
MsgBox xmlhttp.Status
...
Does anybody know what could be causing this?
0
Comment
Question by:dgmoore1
  • 4
  • 3
8 Comments
 
LVL 28

Expert Comment

by:omgang
ID: 34954467
Just taking a stab at this since I don't work with Sharepoint at all...but what happens if you leave off the username and pass?
xmlhttp.Open "PUT", sharepointFileName, False

If you receive a prompt for username and password from the Sharepoint site then it suggests a problem with either the username or password in the variables you are using.  If you still receive the 401 error, however, it suggests a problem witht he URL in the sharepointFileName variable.

OM Gang
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34954469
At the bottom of this page http://msdn.microsoft.com/en-us/library/ms757849%28VS.85%29.aspx, it says that credentials are not automatically sent to the server....
0
 

Accepted Solution

by:
dgmoore1 earned 0 total points
ID: 34955400
I found the problem - the credentials passed must include the domain. I prepended the domain to the username and everything clicked.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34955425
Cool, glad you got it.
0
 

Author Comment

by:dgmoore1
ID: 34955895
I've done this before in other Sharepoint environments and it wasn't necessary to supply the domain name, so this one had me stymied.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34956214
Well, you know they keep changing things...
0
 

Author Comment

by:dgmoore1
ID: 34956532
...and not telling anybody!
0
 

Author Closing Comment

by:dgmoore1
ID: 34990852
Found the solution myself
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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 …

813 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

19 Experts available now in Live!

Get 1:1 Help Now