Computing.Net > Forums > Web Development > ASP error 80070520

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

ASP error 80070520

Reply to Message Icon

Name: Shmanda
Date: September 10, 2004 at 12:10:45 Pacific
OS: WinXPPro
CPU/Ram: plenty
Comment:

Hi and thanks for reading.

I have some asp code here in a login script which validates a user against our Active Directory account info. It works great as long as I enter a correct username and password, but as soon as I enter a bogus password in there it gives me the following error:

error '80070520'
/employees/login.asp, line 22

Here's my code:
============================================================================
strADsPath = "alongdomainname.com"
strPassword = Request.Form("Password")
strUserName = Request.Form("UserName")

if (not strUserName= "") then

strADsPath = "WinNT://" & strADsPath
Dim oADsObject
Dim tempstr
tempstr = strDomain & "\" & strUserName

Set oADsObject = GetObject(strADsPath)

Dim strADsNamespace
Dim oADsNamespace
strADsNamespace = left(strADsPath, instr(strADsPath, ":"))
set oADsNamespace = GetObject(strADsNamespace)
'************ This is line 22:
Set oADsObject = oADsNamespace.OpenDSObject(strADsPath, tempstr, strPassword, 0)

if not (Err.number = 0) then
Response.Write "Please provide a correct login name and password.<br />"
Response.Write err.description & "

"
if err.number = -2147022987 then
Response.write "<strong>Your account has been locked!</strong>"
end if
else
'Set session variables and show the page to the member
========================================================================

So how come it isn't catching this error at if not (Err.number = 0) then ... ?

The only thing I could find on this error number was a vague reference about some servers not accepting domain names longer than 16 characters, which it is. Anyone have a clue?



Sponsored Link
Ads by Google

Response Number 1
Name: Cerj (by cerj)
Date: September 13, 2004 at 03:17:21 Pacific
Reply:

You need to have a "On error resume next" before your line 22

cerj


0

Response Number 2
Name: Shmanda
Date: September 14, 2004 at 11:20:45 Pacific
Reply:

Sweet!!! I was putting it on line 23 and it didn't do anything. Thanks!!


0

Response Number 3
Name: Dr. Nick
Date: September 15, 2004 at 23:33:42 Pacific
Reply:

Just a thought:

You might want to make the code a little more robust by using something like "On error Goto errorLabel" instead of the Resume Next statement.

Then, someplace in your code add a label named 'errorLabel' and output some text saying something about bad passwords or just a generic error statement. Right after this put a "Response.End" statement to end the code execution.

This makes the code cleaner and less prone to security issues in my opinion.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: ASP error 80070520

ASP intranet form code www.computing.net/answers/webdevel/asp-intranet-form-code/1912.html

ADODB connection to Oracle 7 www.computing.net/answers/webdevel/adodb-connection-to-oracle-7/121.html

ASP 0201 error www.computing.net/answers/webdevel/asp-0201-error/3526.html