I have created a sp querying LDAP such as:ALTER PROCEDURE [dbo].[sp_LDAP_Query] as set nocount onselect * from openquery(ADSI, ' select title, sAMAccountName, displayName, userAccountControlfrom ''LDAP://DC=xxx,DC=COM'' where objectCategory = ''User''') where title is not null and (userAccountControl <> '66050' and userAccountControl <> '514')order by displayName
I sign on to Sequel Server 2005 in Windows Authentication mode and execute the sp:exec vecellio.dbo.sp_LDAP_Query
A result set is returned. So far, so good.Now in ASP I have a connection string like:<add key="ConnectionString" value="Data Source=VGIBESQL;Initial Catalog=XXX;Integrated Security=SSPI;"/>
also using Windows Authentication and code to call the same sp:If mySqlConnection.State = Data.ConnectionState.Closed Then mySqlConnection.Open() End If Try mySqlCommand.Connection = mySqlConnection mySqlCommand.CommandType = Data.CommandType.StoredProcedure mySqlCommand.CommandText = ("vecellio.dbo.sp_LDAP_Query") mySqlCommand.Connection = mySqlConnection mySqlDataAdapter.SelectCommand = mySqlCommand mySqlDataAdapter.Fill(mySqlDataTable) Session("myMenuDataTable") = mySqlDataTable Catch ex As Exception Message = ex.ToString myError = True End TryNow I get error on the "mySqlCommand.ExecuteScalar()" line:System.Data.SqlClient.SqlException: An error occurred while preparing the query " select title, sAMAccountName, displayName, userAccountControlfrom 'LDAP://DC=Vecelliogroup,DC=COM' where objectCategory = 'User'" for execution against OLE DB provider "ADsDSOObject" for linked server "ADSI".
Any ideas???