|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
cannot query directory servicesI would like to query informations that are located in the (AD) Active Directory Windows 2003 with my server Windows 2000SP4 and MS SQL 2000 SP4 in the same domain and AD. I create the link server with the following script : EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5', 'ADSDSOObject', 'adsdatasource' GO and I query AD with the following : SELECT [Name], SN [Last Name], ST State FROM OPENQUERY( ADSI, 'SELECT Name, SN, ST FROM ''LDAP://ADSISrv/ OU=myOU,DC=mycompagny,DC=com'' WHERE objectCategory = ''Person'' AND objectClass = ''contact''') GO Then I get the following 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]. I clarify that I used Integrated Windows security and also used the USERID and password of service SQLserver as recommanded to launch my query. But I get the above error. Why ? Thanks for your next reply, Job Hi
You may get a better response in the ADSI news groups e.g microsoft.public.adsi.general, but I think the error is probably because the syntax of your query is incorrect, check out http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/adsi_ldap_provider.asp John Show quoteHide quote "Job" wrote: > Dear all, > > I would like to query informations that are located in the (AD) Active > Directory Windows 2003 with my server Windows 2000SP4 and MS SQL 2000 SP4 in > the same domain and AD. > I create the link server with the following script : > > EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5', > 'ADSDSOObject', 'adsdatasource' > GO > > and I query AD with the following : > > SELECT [Name], SN [Last Name], ST State > FROM OPENQUERY( ADSI, > 'SELECT Name, SN, ST > FROM ''LDAP://ADSISrv/ OU=myOU,DC=mycompagny,DC=com'' > WHERE objectCategory = ''Person'' AND > objectClass = ''contact''') > GO > > Then I get the following 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]. > > I clarify that I used Integrated Windows security and also used the USERID > and password of service SQLserver as recommanded to launch my query. > But I get the above error. Why ? > Thanks for your next reply, > Job > > >
Why would the Database Engine Tuning Advisor recommend an non-clustered index if there is already a
Migrate DBs off dying server IMPORT DBASE IV (DBF) FILE TO SQL SERVER 2005 SQL 2000 - Convert varchar to datetime or smalldatetime Opportunity to provide feedback on performance improvements in SQL Server... Profiler Question SQL Server linked server performance under high-volume scenarios restrict enterprise manager to see all the databases Connection Problem set column default value error |
|||||||||||||||||||||||