ASP to ASP.NET

S

sck10

Hello,

I inherited the following piece of code.

Dim LDAP_CONN, LDAP_COM, RS, sql, strPrint, strFields
Set LDAP_CONN = CreateObject("ADODB.Connection")
LDAP_CONN.Provider = "ADsDSOObject"
LDAP_CONN.Open
Set LDAP_COM = CreateObject("ADODB.Command")
Set LDAP_COM.ActiveConnection = LDAP_CONN
sql = "SELECT employeeNumber, name FROM 'LDAP://ldap-uscentral.post..com'
WHERE employeenumber='" & HRID & "'"
Set RS = LDAP_CONN.Execute(sql)

My problem is how to declare LDAP_CONN and LDAP_COM since the database is
using a URL ('LDAP://ldap-uscentral.post.com'). Also, how would I use the
repeater tool with this instead of a recordset.
ASP.NET
Dim strSQL As String = "SELECT employeeNumber, name FROM
'LDAP://ldap-uscentral.post.com' WHERE employeenumber='" & HRID & "'"
Dim LDAP_CONN as NEW OleDbConnection
Dim LDAP_COM As New OleDbCommand(strSQL, LDAP_CONN)
Dim RS, strPrint as string="", strFields as string=""

LDAP_CONN.Provider = "ADsDSOObject"
LDAP_CONN.Open
LDAP_COM = CreateObject("ADODB.Command")
Set LDAP_COM.ActiveConnection = LDAP_CONN
 
S

Steven Cheng[MSFT]

Hi Sck10,

Welcome to .NET newsgroup.
As for the ADSI query problem you mentioned, in .net , we're recommend to
use the components under the System.DirectoryServices namespace which are
purely .net based classes and won't need COM interop with classic COM
interfaces. Here are some related reference in MSDN:

#Searching Active Directory Hierarchies
http://msdn.microsoft.com/library/en-us/vbcon/html/vbtskSearchingActiveDirec
toryHierarchy.asp?frame=true

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top