Skip to Content
0
Former Member
Jun 05, 2013 at 04:36 PM

LDAP using OLE DB

149 Views

Hi All,

I am trying to use OLE DB to connect to LDAP using ADsDSOObject provider. I am not sure if the below code is correct, but this is an attempt from me and I would appreciate any help on this subject as I am not finding anything when I google. When I test the code, I get the error saying "// The current provider does not support the interface. IDBSchemaRowset" on line where I try to connect using ldap_trans.

// Profile LDAP
transaction ldap_trans
datastore lds_rs
string ls_sql

ldap_trans = create transaction
ldap_trans.DBMS = "OLE DB"
ldap_trans.LogPass = as_password
ldap_trans.LogId = as_user
ldap_trans.AutoCommit = False
ldap_trans.DBParm = "PROVIDER='ADsDSOObject'"
connect using ldap_trans; // The current provider does not support the interface. IDBSchemaRowset
lds_rs = create datastore
lds_rs.settransobject(ldap_trans)
ls_sql = "SELECT ADsPath,title, telephoneNumber From 'ldap://ipaddress:389/dc=xyz,dc=net' WHERE objectClass='user' AND objectCategory='Person'"
lds_rs.setsqlselect(ls_sql)
lds_rs.retrieve()
lb_result = lds_rs.rowcount() > 0
disconnect using ldap_trans;
if isvalid(lds_rs) then destroy lds_rs
if isvalid(ldap_trans) then destroy ldap_trans
If lb_result Then
return 0
Else
return -1
End If

Any help will be much appreciated !!

Thanks,

Chirag Vora