Solved

Sharepoint 2010: xmlhttp PUT in VBA denied with valid credentials

Posted on 2011-02-22
8
1,260 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 82

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
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 34955425
Cool, glad you got it.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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 82

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

746 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

13 Experts available now in Live!

Get 1:1 Help Now