Credit Reports | Power Rangers | Student Credit Cards | Share Prices | Car Finance
LDAP Scripting Advice Needed [Archive] - ZGeek

PDA

View Full Version : LDAP Scripting Advice Needed


dwarfthrower
19-05-2005, 12:39 PM
OK... trying to get a web application to be able to function as a rudimentary LDAP client. Using the ADO ActiveX control to handle records etc, but running into a stumbling block on the formatting of the actual LDAP requests.

So, using a public LDAP server, the following url works fine:

ldap://pksldap.tttc.de/c=DE??sub?(objectclass=*)

yet the following code is giving me a "Table Does Not Exist" error:

function testLdap(){

// Create Connection
var objConn = new ActiveXObject("ADODB.Connection")
var objRS = new ActiveXObject("ADODB.Recordset")
objConn.Provider = "ADsDSOObject"
var strConn = "Active Directory Provider"
objConn.Open(strConn)

// Create SQL Query String

// Working URL
// ldap://pksldap.tttc.de/c=DE??sub?(objectclass=*)

var strQuery = "Select * FROM 'LDAP//pksldap.tttc.de/c=DE' WHERE objectClass = '*'";

// Open Recordset
objRS.Open(strQuery,objConn,1,1);
var intRowCount = objRS.recordcount;
alert(intRowCount);
}

Any ideas?

plext
19-05-2005, 06:55 PM
Select * FROM 'LDAP://pksldap.tttc.de/c=DE

: being the difference.

dwarfthrower
19-05-2005, 06:57 PM
Thanks for that, but I've taken a different angle using GetObject and enumerators,

plext
19-05-2005, 06:59 PM
GetObject is good, but I find it slower than a recordset for multiple returns.

dwarfthrower
19-05-2005, 07:02 PM
Aye... I see what you mean... cheers for that.

Remind me to buy you a beer next time I'm in Dublin ;)