Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specifying a port number for a linked server?

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
I have successfully created a linked server to Active Directory and I believe the default port number is 389.

I've been unsuccessfull in creating a linked server to LDAP located on another server. I belive my problem is that the port number is not 389. So, how do I specify the port number when defining a linked server?
 
I would assume that you just add :999 after the ldap domain name.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
I've tried that but I'm not sure if my syntax is correct.

I've created a stored procedure that uses ADO to make the connection and returns the results in a recordset. Which works but I can't join the procedure to tables. The syntax I'm using to make the ADO connection is: 'SELECT displayName, employeeNumber FROM ''LDAP://ServerName:389/ou=users,ou=dem,dc=xx,dc=yyyy,dc=zzz'' WHERE objectClass=''inetorgperson'' '

I also had to set the Provider string of the ADO connection to: 'Provider=ADsDSOObject;Password=MyPassword;User ID="UserName";Encrypt Password=False;Mode=Read;Bind Flags=0;ADSI Flag=-2147483648'

When I launch the iPlanet Console the Administration URL is (I'm assuming that the port number is 1234)

I set up the linked server as follows:

Linked Server: ServerName
Provider Name: OLE DB Provider for Microsoft Directory Service
Produce Name: iPlanet Directory Server
Data Source: AdsDataSource
Provider String: ADsDSOObject;Password=MyPassword;User ID="UserName";Encrypt Password=False;Mode=Read;Bind Flags=0;ADSI Flag=-2147483648

I created a view to query the linked server, but no luck. This is what my view looks like.

Do I have a syntax error some place?

Code:
SELECT     TOP 100 PERCENT *
FROM         OPENQUERY(ServerName, 
                      'SELECT  displayName, employeeNumber FROM ''LDAP://ou=users,ou=dem,dc=xx,dc=yyyy,dc=zzz:1234''  WHERE objectClass=''inetorgperson'' ') 
                      Rowset_1
 
Shouldn't it look like this?
Code:
SELECT     TOP 100 PERCENT *
FROM         OPENQUERY(ServerName, 
                      'SELECT  displayName, employeeNumber FROM ''LDAP://domain.com:1234/ou=users,ou=dem,dc=xx,dc=yyyy,dc=zzz''  WHERE objectClass=''inetorgperson'' ') 
                      Rowset_1

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
No luck. But thanks for looking at my problem. I'm still getting the same error

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'd ask with the LDAP folks. Maybe they have some good info.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top