Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

PB and LDAP

5 posts in Objects Last posting was on 2006-11-21 15:49:44.0Z
Sharon Lim Posted on 2006-11-21 14:08:01.0Z
Sender: 1315.455e1176.1804289383@sybase.com
From: Sharon Lim
Newsgroups: sybase.public.powerbuilder.objects
Subject: PB and LDAP
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <45631650.6969.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 21 Nov 2006 07:08:01 -0700
X-Trace: forums-1-dub 1164121681 10.22.241.41 (21 Nov 2006 07:08:01 -0700)
X-Original-Trace: 21 Nov 2006 07:08:01 -0700, 10.22.241.41
Lines: 39
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9125
Article PK: 736304

I am trying to do an LDAP call but cannot construct the
query properly. It does not like the sqlStmt where it
defines the ldap server.

Is there a better way to do the call if all I know is the
uid? In other words, I don't have the 'ou' information?

oleobject iole_script
iole_Script = CREATE oleobject
li_Rc =
iole_Script.ConnectToNewObject('MSScriptControl.ScriptControl')
If li_Rc <> 0 Then
MessageBox("OLE Error", string(li_Rc) + ' Error
connecting to MSScriptControl.ScriptControl')
Return FALSE
End if
iole_Script.Language = 'VBScript'
ls_Code = &
'Dim con As New Connection~r~n' + &
'Dim sqlStmt As String~r~n' + &
'Dim connStr As String~r~n' + &
'Dim rs As Recordset~r~n' + &
'sqlStmt = ="select uid from
'LDAP://LDAP.ABC.COM:389/o=abc'"~r~n' + &
' "where uid='" & m_Initial & "'" & " and
objectClass='*'"~r~n' + &
' Set con = CreateObject("adodb.connection")~r~n' + &
' con.Provider = "ADSDSOOBject"~r~n' + &
' connStr = "uid=" & m_Initial & ",ou=" & m_OrgUnit &
",o=" & m_Org~r~n' + &
' con.Open "ADs Provider", connStr, m_Password~r~n' + &
' Set rs = con.Execute(sqlStmt)~r~n' + &
' Authenticate = (Err.Number = 0) And (rs.Fields.Count >
0)~r~n' + &
' rs.Close~r~n'
iOle_script.AddCode (ls_Code)
script_Result = iole_Script.Eval(ls_Code)
iole_Script.DisConnectObject()
destroy iole_script


Terry Dykstra Posted on 2006-11-21 14:36:08.0Z
Reply-To: "Terry Dykstra" <dontreply_tddykstra@forestoil.ca.x>
From: "Terry Dykstra" <tddykstra@forestoil.ca>
Newsgroups: sybase.public.powerbuilder.objects
References: <45631650.6969.1681692777@sybase.com>
Subject: Re: PB and LDAP
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: gw.forestoil.ca
X-Original-NNTP-Posting-Host: gw.forestoil.ca
Message-ID: <45631ce8$1@forums-1-dub>
Date: 21 Nov 2006 07:36:08 -0700
X-Trace: forums-1-dub 1164123368 72.29.237.65 (21 Nov 2006 07:36:08 -0700)
X-Original-Trace: 21 Nov 2006 07:36:08 -0700, gw.forestoil.ca
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9127
Article PK: 736305

On CodeExchange there are some examples of using LDAP.

--
Terry Dykstra (TeamSybase)
http://powerbuilder.codeXchange.sybase.com/
http://www.pb9books.com
product enhancement requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement

<Sharon Lim> wrote in message news:45631650.6969.1681692777@sybase.com...
>I am trying to do an LDAP call but cannot construct the
> query properly. It does not like the sqlStmt where it
> defines the ldap server.
>
> Is there a better way to do the call if all I know is the
> uid? In other words, I don't have the 'ou' information?
>
> oleobject iole_script
> iole_Script = CREATE oleobject
> li_Rc =
> iole_Script.ConnectToNewObject('MSScriptControl.ScriptControl')
> If li_Rc <> 0 Then
> MessageBox("OLE Error", string(li_Rc) + ' Error
> connecting to MSScriptControl.ScriptControl')
> Return FALSE
> End if
> iole_Script.Language = 'VBScript'
> ls_Code = &
> 'Dim con As New Connection~r~n' + &
> 'Dim sqlStmt As String~r~n' + &
> 'Dim connStr As String~r~n' + &
> 'Dim rs As Recordset~r~n' + &
> 'sqlStmt = ="select uid from
> 'LDAP://LDAP.ABC.COM:389/o=abc'"~r~n' + &
> ' "where uid='" & m_Initial & "'" & " and
> objectClass='*'"~r~n' + &
> ' Set con = CreateObject("adodb.connection")~r~n' + &
> ' con.Provider = "ADSDSOOBject"~r~n' + &
> ' connStr = "uid=" & m_Initial & ",ou=" & m_OrgUnit &
> ",o=" & m_Org~r~n' + &
> ' con.Open "ADs Provider", connStr, m_Password~r~n' + &
> ' Set rs = con.Execute(sqlStmt)~r~n' + &
> ' Authenticate = (Err.Number = 0) And (rs.Fields.Count >
> 0)~r~n' + &
> ' rs.Close~r~n'
> iOle_script.AddCode (ls_Code)
> script_Result = iole_Script.Eval(ls_Code)
> iole_Script.DisConnectObject()
> destroy iole_script


Sharon Lim Posted on 2006-11-21 14:51:12.0Z
Sender: 1315.455e1176.1804289383@sybase.com
From: Sharon Lim
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: PB and LDAP
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <45632070.6b62.1681692777@sybase.com>
References: <45631ce8$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 21 Nov 2006 07:51:12 -0700
X-Trace: forums-1-dub 1164124272 10.22.241.41 (21 Nov 2006 07:51:12 -0700)
X-Original-Trace: 21 Nov 2006 07:51:12 -0700, 10.22.241.41
Lines: 54
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9128
Article PK: 736309

>Site is unavailable. Need to resolve immediately.

On CodeExchange there are some examples of using LDAP.

>
> --
> Terry Dykstra (TeamSybase)
> http://powerbuilder.codeXchange.sybase.com/
> http://www.pb9books.com
> product enhancement requests:
> http://my.isug.com/cgi-bin/1/c/submit_enhancement
>
> <Sharon Lim> wrote in message
> news:45631650.6969.1681692777@sybase.com... >I am trying
> > to do an LDAP call but cannot construct the query
> > properly. It does not like the sqlStmt where it defines
> the ldap server. >
> > Is there a better way to do the call if all I know is
> > the uid? In other words, I don't have the 'ou'
> information? >
> > oleobject iole_script
> > iole_Script = CREATE oleobject
> > li_Rc =
> >
> iole_Script.ConnectToNewObject('MSScriptControl.ScriptCont
> > rol') If li_Rc <> 0 Then
> > MessageBox("OLE Error", string(li_Rc) + ' Error
> > connecting to MSScriptControl.ScriptControl')
> > Return FALSE
> > End if
> > iole_Script.Language = 'VBScript'
> > ls_Code = &
> > 'Dim con As New Connection~r~n' + &
> > 'Dim sqlStmt As String~r~n' + &
> > 'Dim connStr As String~r~n' + &
> > 'Dim rs As Recordset~r~n' + &
> > 'sqlStmt = ="select uid from
> > 'LDAP://LDAP.ABC.COM:389/o=abc'"~r~n' + &
> > ' "where uid='" & m_Initial & "'" & " and
> > objectClass='*'"~r~n' + &
> > ' Set con = CreateObject("adodb.connection")~r~n' + &
> > ' con.Provider = "ADSDSOOBject"~r~n' + &
> > ' connStr = "uid=" & m_Initial & ",ou=" & m_OrgUnit &
> > ",o=" & m_Org~r~n' + &
> > ' con.Open "ADs Provider", connStr, m_Password~r~n' +
> > & ' Set rs = con.Execute(sqlStmt)~r~n' + &
> > ' Authenticate = (Err.Number = 0) And
> > (rs.Fields.Count > 0)~r~n' + &
> > ' rs.Close~r~n'
> > iOle_script.AddCode (ls_Code)
> > script_Result = iole_Script.Eval(ls_Code)
> > iole_Script.DisConnectObject()
> > destroy iole_script
>
>