Solved

Sharepoint 2010: xmlhttp PUT in VBA denied with valid credentials

Posted on 2011-02-22
8
1,274 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
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34955425
Cool, glad you got it.
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.

 

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

867 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

22 Experts available now in Live!

Get 1:1 Help Now