Query error on ADSI Linked Server

  • Hi

    I have set up a linked server to Active Directory and receive the following error when I run a query in EM against the view setup in the pubs database which includes the description field of an AD user. If I leave out the description field the query runs correctly

    IRowSet::GetData returned 0x40eda COLUMN NAME=description STATUS=DBSTATUS_E_CANTCONVERTVALUE

    server =W2K

    instance running as domain account (member of group administrators)

    script as follows

    
    
    if exists(select 1 from master..sysservers where srvname = 'ADSITest') exec sp_dropserver 'ADSITest', 'droplogins'
    go
    exec sp_addlinkedserver
    'ADSITest',
    'My Active DirectoryTest',
    'ADSDSOObject',
    'adsdatasource'
    go
    use pubs
    go
    IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS
    WHERE TABLE_NAME = 'vw_ADFunnies')
    DROP VIEW vw_ADFunnies
    go
    Create view vw_ADFunnies as
    Select * from OpenQuery(ADSITest,'select samAccountName,CN,ADsPath,description
    from
    ''LDAP://ServerName/OU=Teachers,OU=Staff,DC=DomName,DC=Local'' where objectCategory
    = ''Person'' ')
    go

    Does ANYONE have a solution ????

  • This was removed by the editor as SPAM

  • The error I am getting is related to the field type

    There are a number of fields in AD which are "multivalue" fields ie array fields

    Description, country, SMTP address are examples of these fields

    How do I access these fields in a query at the same time as the other fields?

  • I have a similar problem. I create a linked server, as:

     

    exec sp_addlinkedserver 'ADSITest', 'My Active DirectoryTest', 'ADSDSOObject',

    'adsdatasource'

    go

    exec sp_addlinkedsrvlogin 'ADSITest', false, 'username',

    'username', 'password'

    go

    select * from openquery(ADSI, 'SELECT * FROM "LDAP://tst/cn=Users,DC=uchicago,DC=edu)

    go

     

    The domain that I'm trying to reach is tst.uchicago.edu

    any ideas, please reply to cbeatley@gsb.uchicago.edu

     

    Thank you

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply