HELP: Embedding ADSI in ASP pages 
Author Message
 HELP: Embedding ADSI in ASP pages

IIS 5.0
Windows 2000 Advanced Server, SP3
Active Directory
VBScript
IE 6

I'm getting an error when I attempt to search Active Directory using
ASDI from within an .asp page.  The script runs fine when written as a
.vbs file and run under either Cscript or Wscript.

The error number (script exerp and error details included below) is
0x80004005, which seems to be associated with lots of potential
problems.  Specific steps I have taken to troubleshoot include:

1) Making sure global.asa is firing by adding a Session_OnStart sub that
echoes the system time back to the client browser.

2) Checking for permission problems by setting the virtual folder
containing global.asa to Basic Authentication and then logging in to the
page as a domain administrator.

3) I've run Filemon on the server while accessing the page from a
client; all file accesses succeed.

4) Changing CreateObject to Server.CreateObject within the .asp file

5) The error message is generated off of this line:

Set objRecordSet = objCommand.Execute

I'm new at all this, but am really trying to dig through everything on
my own.  I know when I need help, though.  Thanks for articles, info, or
discussion that helps makes me less clueless.

SCRIPT EXERP: (Please ignore word wrapping)

Set objConnection = Server.CreateObject("ADODB.Connection")
If Err <> 0 Then
  Response.Write "Server.CreateObject(Connection): " & Err.Number &
" --- " & Err.Description
  Err.Clear
End If

objConnection.Open = "Provider=ADsDSOObject;"
If Err <> 0 Then
  Response.Write "objConnection.Open: " & Err.Number & " --- " &
Err.Description
  Err.Clear
End If

Set objCommand = Server.CreateObject("ADODB.Command")
If Err <> 0 Then
  Response.Write "Server.CreateObject(Command): " & Err.Number & " ---
" & Err.Description
  Err.Clear
End If

objCommand.ActiveConnection = objConnection
If Err <> 0 Then
  Response.Write "objCommand.ActiveConnection: " & Err.Number & " --- "
& Err.Description
  Err.Clear
End If

objCommand.CommandText = "<LDAP://dc=DOMAIN,dc=net>;(&
(objectCategory=User) (sn=C*))" & _
       ";sn,givenName,sAMAccountName;subtree"      
If Err <> 0 Then
  Response.Write "objCommand.CommandText: " & Err.Number & " --- " &
Err.Description
  Err.Clear
End If      

' this statement generates the error:

Set objRecordSet = objCommand.Execute
If Err <> 0 Then
  Response.Write "objRecordSet = objCommand.Execute: " & Err.Number &
" --- " & Err.Description
  Err.Clear
End If

ERROR MESSAGE showing in client browser:

The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot
be displayed.

------------------------------------------------------------------------
--------

Please try the following:

Click the Refresh button, or try again later.

Open the HOST.DOMAIN.net home page, and then look for links to the
information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

------------------------------------------------------------------------
--------

Technical Information (for support personnel)

Error Type:
Provider (0x80004005)
Unspecified error
/searchUser.asp, line 67

Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Page:
POST 19 bytes to /searchUser.asp

POST Data:
laName=S*&B1=Submit

Time:
Monday, March 10, 2003, 2:55:49 PM

More information:
Microsoft Support

--

.com          ...................    <><     ..................

"Madonna represents fame; Helen Keller represents success."  
                                                -- Erma Bombeck



Sat, 27 Aug 2005 06:50:00 GMT  
 HELP: Embedding ADSI in ASP pages

Quote:

>I'm getting an error when I attempt to search Active Directory using
>ASDI from within an .asp page.  The script runs fine when written as a
>.vbs file and run under either Cscript or Wscript.

>The error number (script exerp and error details included below) is
>0x80004005, which seems to be associated with lots of potential
>problems.  Specific steps I have taken to troubleshoot include:

These are usually permission related errors.  Are you authenticating
the user or using the anonymous user account?  Does the authenticated
user have permissions to the AD and/or possibly registry?

Quote:
>Error Type:
>Provider (0x80004005)
>Unspecified error
>/searchUser.asp, line 67

I can't tell from your script which is this line.

Jeff



Sat, 27 Aug 2005 21:25:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP: Embedding ADSI in ASP pages

2. Differences between UpdateSQL component and Query.ExecSQL

3. Passing Strings as Va

4. **HELP**.. where can I find some DECENT mscdex documentation.

5. program analysis / turbo profiler

6. embed caching and page scrolling - HELP!

7. Need Help Manipulating a control on an Embedded Data Access Page

8. How to call script in HMTL page, from ActiveX control embedded in same page

9. embed a new htm page into an main page

10. RegisterLibraryFunction???????

11. DBase, Paradox, InerBase, Which to choose ?

12. calling asp page from another asp page

 

 
Powered by phpBB® Forum Software