Solved

Exchange Database ODBC

Posted on 2001-08-01
4
274 Views
Last Modified: 2012-05-04
How can I access my Exchange Database by ODBC? This includes updating user information such
as phone numbers.
0
Comment
Question by:Kriscott
4 Comments
 
LVL 5

Accepted Solution

by:
rkot2000 earned 200 total points
ID: 6341330
1. you can link exchage to msaccess 2000
2. i did some development with ldap and ado:
ldap is free from microsoft.

server = "001-expo9-d"

LastName = txtLastName.Text

'strQuery = "<LDAP://" + server + _
'    ">;(&(objectClass=organizationalPerson)(rdn=" + _
'    LastName + "));cn,adspath,Assoc-NT-Account,givenName,Title,Department,Company,Hide-From-Address-Book,l,st,PostalCode,Co,telephoneNumber,rfc822Mailbox;subtree"

strQuery = "<LDAP://" + server + _
    ">;(&(objectClass=organizationalPerson)(sn=" + _
    LastName + "));cn,givenName,telephoneNumber;subtree"
   
strQuery = "<LDAP://" + server + _
    ">;(&(objectClass=organizationalPerson)(sn=" + _
    LastName + "));cn,givenName,telephoneNumber,Deparment;subtree"
   
strQuery = "<LDAP://" + server + _
    ">;(&(objectClass=organizationalPerson)(sn=" + _
    LastName + "));cn,sn,name,postalAddress,department;subtree"
   
   
'   LDAP                    Exchange
'
'   Name                    Alias
'   givenName               Given Name
'   sn                      SurName
'   Title                   Title
'   Deparment               Department
'   Company                 Company
'   postalAddress           Address
'   l                       City
'   st                      Street
'   PostalCode              Postal Code
'   Co                      Country
'   telephoneNumber         Telephone Number
   
   
Set objRS = New ADODB.Recordset
objRS.CursorLocation = adUseClient

Set objRS = ADOConn.Execute(strQuery)

If objRS.BOF And objRS.EOF Then
  MsgBox ("Person not found")
Else
  Dim x As Recordset
  Dim f As Field
  Dim i As Long
  Set x = New ADODB.Recordset
  For Each f In objRS.Fields
    x.Fields.Append f.Name, f.Type, f.DefinedSize
  Next
  x.Open
  objRS.MoveFirst
  For i = 0 To objRS.RecordCount - 1
    x.AddNew
    For Each f In objRS.Fields
      x.Fields(f.Name).Value = objRS.Fields(f.Name).Value & " "
    Next
    x.Update
    objRS.MoveNext
  Next
  'Set x = objRS
  x.MoveFirst
  Set SSOleDBGrid1.DataSource = x
  'se
'  SSOleDBGrid1.ReBind
 '  MsgBox objRS.RecordCount
   
'        While Not objRS.EOF
'            If objRS.Fields("givenname") = txtFirstName.Text Then
'        txtPhoneNumber.Text = objRS.Fields("telephoneNumber").Value
'        Exit Sub
'        End If
       
       
       
'        objRS.MoveNext
'   Wend
   
End If
End Sub

Private Sub getConnection()
Set ADOConn = CreateObject("ADODB.Connection")

    ADOConn.Provider = "ADSDSOObject"
    ADOConn.Open "ADs Provider"
   
End Sub
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6342450
hearing...
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7198380
Hi Kriscott,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept rkot2000's comment(s) as an answer.

Kriscott, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7213208
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now