Wednesday, March 28, 2012

Linking Active Directory to SQL Server 2000

Hi,

everyone I'm trying to link an Active Directory to the SQL Server.
Unluckily I came across some problems and the information I found in the archive of this
forum didn't help me.
I got the link basically running by following code:

EXEC sp_addlinkedserver 'TEST', 'Active Directory Services 2.5', 'ADSDSOObject', 'LDAP://testserver.test.de'

select * from openquery(TEST, '<LDAP://testserver.test.de>;(&(objectClass=Person)(sn=Smith));adspath;subtree')

Unluckily I'm not able to query any other attributes then adspath. Trying the following code results in an error:

select * from openquery(TEST, '<LDAP://testserver.test.de>;(&(objectClass=Person)(sn=Smith));sn;subtree')

I receive the following error message:

OLE DB-Fehlertrace [Non-interface error: OLE DB provider ADSDSOObject returned DBPROP_STRUCTUREDSTORAGE without DBPROPVAL_OO_BLOB being supported].
OLE DB-Fehlertrace [OLE/DB Provider 'ADSDSOObject' IRowset::GetData returned 0x80040e21: Data status returned from the provider: [COLUMN_NAME=sn STATUS=DBSTATUS_E_CANTCONVERTVALUE]].

The administrator of the Active directory service told me that my queries have successfully been executed and
correct values have been returned.

Does anyone have an idea what might cause my problems?

ThanksRefer to this KBA (http://support.microsoft.com/default.aspx?scid=kb;en-us;Q299410) about performing query using ADSI.|||Thanks, but I know this article already. I thought that maybe the chapter about limitations might be of interest for me especially the point about multivalued properties.
However I cross checked all limitations with the admin. of my Active Directory Service. The second query which I posted as not running only returns one value. Also I checked the query with a Delphi application of my colleague and the application returned correctly a string value of the surname. Nevertheless my SQL Server always tells me that it cannot convert a value.|||What was the error during the conversion?|||Well I'm not doing an explicit conversion. The statement which causes the error message which indicates me that there is something wrong with a conversion is:

select * from openquery(TEST, '<LDAP://testserver.test.de>;(&(objectClass=Person)(sn=Smith));sn;subtree')

and the error message is:

Server: Nachr.-Nr. 7346, Schweregrad 16, Status 2, Zeile 1
Could not get the data of the row from the OLE DB provider 'ADSDSOObject'. Could not convert the data value due to reasons other than sign mismatch or overflow.
OLE DB error trace [OLE/DB Provider 'ADSDSOObject' IRowset::GetData returned 0x80040e21: Data status returned from the provider: [COLUMN_NAME=sn STATUS=DBSTATUS_E_CANTCONVERTVALUE]].

Unluckily I also don't know of any tool with which I might be able to monitor the OLE DB provider to see what values and type of values are transfered.

Is there any way to do explicit conversions of data types within the LDAP syntax of the OPENQUERY statement?

No comments:

Post a Comment