Solved

Integrating Outlook2000 with either Access or MSSQL

Posted on 2000-02-24
3
193 Views
Last Modified: 2010-04-08
I am trying to integrate Outlook2000 with both Access and Microsoft SQL Server.
I know it can be done ith ADO, but all the stuff I can find at Microsoft and other places, seem to assume a level of understanding that I just do NOT have.
If anyone can help me here with either samples or working code fragments, it would be really helpful.
0
Comment
Question by:Matlock
3 Comments
 
LVL 16

Expert Comment

by:Neo_mvps
ID: 2556418
I'm not sure if this will help or hinder you, but give http://www.slipstick.com/dev/database.htm a peek.
0
 
LVL 6

Accepted Solution

by:
Jon_Raymond earned 100 total points
ID: 2556590
What level do you have?  You have to know a minimum of programming fundamentals, like referencing the outlook object from VB or referencing Access from outlook (which one are you trying to do?).  You have to know how to make a connection either way.  This is basically simple.  You dim the ADO connection and recordset objects then go to work:


    Dim iRow As Integer
    Dim iCol As Integer
    Dim rs As ADODB.Recordset
    Dim conn As ADODB.Connection
    Dim strCnn As String
    ' Open a connection using a DSN and ODBC tags.
    Set conn = New ADODB.Connection
    'conn.ConnectionString = "DSN=SLXDSN;UID=sysdba;pw=masterkey"
    conn.Open "DSN=SLXDSN"
    strCnn = "Provider=sqloledb;server = JONRWIN98;" _
        & "uid=sa;pwd=;database=pubs"
    If conn Is Nothing Then
        Set conn = New ADODB.Connection
    End If
    Set rs = New ADODB.Recordset
    rs.Open "dbo.spTestIndex_Employee", strCnn, adOpenDynamic, adLockPessimistic
    ' use Getrows to put the recordset into an array:
    vCurrentArray = rs.GetRows(10, iRecordNumber)
    ' if you don't use getrows you can do this with a recordset
    ' from a stored procedure that limits the rows returned
    'with the same parameters that getrows uses:
   
    'Do While Not rs.EOF
    '    For iCol = 0 To 2
    '       vCurrentArray(iCol, iRow) = rs(iCol)
    '    Next                'iCol
    '    rs.MoveNext'
    'Loop
   
    'or loop through the recordset itself:
    With rs
        Do While Not .EOF
            'do some thing here with each record:
            vVariable1 = rs(0) ' the first field by number or
            vVariable2 = rs("Field 2") ' the second field by its name in quotes
        Loop
    End With
   
   
For samples of how to manipulate Outlook objects see:
http://www.microsoft.com/outlookdev/articles/outprog.htm

If this is too complicated then coding isn't for you.
0
 

Author Comment

by:Matlock
ID: 2565102
Thanks to both Neo_mvps
 and Jon Raymond, both bits were helpful but I have Accepted Jon's comment as the answer as I have been able to modify his code to make my application ( A VBScript behind an Outlook form to read from SQL7)

Coding isn't the problem, but moving from C/C++ to VB can be ....
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

708 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

16 Experts available now in Live!

Get 1:1 Help Now