ADSI, ADsDSOObject, Error '80040e37' Table does not exist???

O

Ollie

Ok, I'm new to ADSI and am trying use the following code but get the above
error.

The error occurs on the last line...

Dim oRootDSE, oCon, oCmd, oRecordSet
Dim sDomainADsPath, sUser, sPassword, sGroup, sProperties
Dim aDescription, aMember, iCount

Set oRootDSE = GetObject("LDAP://RootDSE")
sDomainADsPath = "LDAP://" & oRootDSE.Get("defaultNamingContext")
Set oRootDSE = Nothing

Response.Write sDomainADsPath

Set oCon = Server.CreateObject("ADODB.Connection")

sUser = ""
sPassword = ""

oCon.Provider = "ADsDSOObject"

oCon.Open "ADProvider", sUser, sPassword

Set oCmd = Server.CreateObject("ADODB.Command")
Set oCmd.ActiveConnection = oCon

sProperties = "name,ADsPath,description,member"
sGroup = "*"

oCmd.CommandText = "<" & sDomainADsPath & ">;(&(objectCategory=group)(name="
& sGroup & "));" & sProperties & ";subtree"
oCmd.Properties("Page Size") = 100

Set oRecordSet = oCmd.Execute
 
O

Ollie

Managed to sort this one myself. Bit of a rookie mistake. username needs to
be "domain\username" not just "username" DOH!

Ok, I'm new to ADSI and am trying use the following code but get the above
error.

The error occurs on the last line...

Dim oRootDSE, oCon, oCmd, oRecordSet
Dim sDomainADsPath, sUser, sPassword, sGroup, sProperties
Dim aDescription, aMember, iCount

Set oRootDSE = GetObject("LDAP://RootDSE")
sDomainADsPath = "LDAP://" & oRootDSE.Get("defaultNamingContext")
Set oRootDSE = Nothing

Response.Write sDomainADsPath

Set oCon = Server.CreateObject("ADODB.Connection")

sUser = ""
sPassword = ""

oCon.Provider = "ADsDSOObject"

oCon.Open "ADProvider", sUser, sPassword

Set oCmd = Server.CreateObject("ADODB.Command")
Set oCmd.ActiveConnection = oCon

sProperties = "name,ADsPath,description,member"
sGroup = "*"

oCmd.CommandText = "<" & sDomainADsPath & ">;(&(objectCategory=group)(name="
& sGroup & "));" & sProperties & ";subtree"
oCmd.Properties("Page Size") = 100

Set oRecordSet = oCmd.Execute
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top