Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Retrieve the Outlook Contacts into an ADO RecordSe...
Author:
Brian Gillham
E-mail:
Click to e-mail author
Website:
http://www.failsafe.co.za
Submitted:
2/13/2002
Version:
VB5
Compatibility:
VB5, VB6
Category:
Databases
Views:
12274
Retrieve the Outlook Contacts into an ADO RecordSet. Try and get information about this snippet from ANYWHERE on the 'NET. I dare you.
Declarations:
'none
Code:
Sub Outlook_Contacts() Dim ADOConn As ADODB.Connection Dim ADORS As ADODB.Recordset Dim strConn As String Set ADOConn = New ADODB.Connection Set ADORS = New ADODB.Recordset With ADOConn 'Change the Connection String below to the correct settings .ConnectionString = "Provider=Microsoft.JET.OLEDB.4.0;Exchange 4.0;MAPILEVEL=Outlook Address Book\;PROFILE=Outlook;TABLETYPE=1;DATABASE=c:\temp" .Open End With With ADORS Set .ActiveConnection = ADOConn .CursorType = adOpenStatic .LockType = adLockReadOnly .Open "Select * from [Contacts]" .MoveFirst 'As a test just itterate thru the first contact Dim i As Long For i = 0 To ADORS.Fields.Count - 1 Debug.Print ADORS(i).Name + vbTab + Format(ADORS(i).Value) Next i .Close End With Set ADORS = Nothing ADOConn.Close Set ADOConn = Nothing End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2023 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement