[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

Integrating Outlook2000 with either Access or MSSQL

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
Matlock
Asked:
Matlock
1 Solution
 
Neo_mvpsCommented:
I'm not sure if this will help or hinder you, but give http://www.slipstick.com/dev/database.htm a peek.
0
 
Jon_RaymondCommented:
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
 
MatlockAuthor Commented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now