Ian Baldwin
2003-10-27 18:14:14 UTC
I am trying, without success, to obtain information from
the Active Directory using a linked server. I've trawled
the internet and found abundant information (including
others with a similar problem) but as yet no solution.
SQL server 2000 SP3 is running on a member server (not a
domain server) in a domain named bs.brookes.ac.uk. As per
the various directions I've created a linked server using
the command:
sp_addlinkedserver 'ADSI', 'Active Directory Service
Interfaces', 'ADSDSOObject', 'adsdatasource'
I've then tried a number of variations on the theme of:
SELECT * FROM OpenQuery( ADSI, 'SELECT name
FROM "LDAP://dc=bs,dc=brookes,dc=ac,dc=uk" WHERE
objectCategory = "Person" AND objectClass= "user"')
Everything I try results in the error:
Server: Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing a query for execution
against OLE DB provider 'ADSDSOObject'.
OLE DB error trace [OLE/DB Provider 'ADSDSOObject'
ICommandPrepare::Prepare returned 0x80040e14].
Any suggestions on how to correct this or track the
problem down will be very warmly received!
Ian
the Active Directory using a linked server. I've trawled
the internet and found abundant information (including
others with a similar problem) but as yet no solution.
SQL server 2000 SP3 is running on a member server (not a
domain server) in a domain named bs.brookes.ac.uk. As per
the various directions I've created a linked server using
the command:
sp_addlinkedserver 'ADSI', 'Active Directory Service
Interfaces', 'ADSDSOObject', 'adsdatasource'
I've then tried a number of variations on the theme of:
SELECT * FROM OpenQuery( ADSI, 'SELECT name
FROM "LDAP://dc=bs,dc=brookes,dc=ac,dc=uk" WHERE
objectCategory = "Person" AND objectClass= "user"')
Everything I try results in the error:
Server: Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing a query for execution
against OLE DB provider 'ADSDSOObject'.
OLE DB error trace [OLE/DB Provider 'ADSDSOObject'
ICommandPrepare::Prepare returned 0x80040e14].
Any suggestions on how to correct this or track the
problem down will be very warmly received!
Ian