Example of VBA code running in Outlook 2016 to connect to SQL Express

This VBA example was configured to run in Outlook 2016. It connects to a local SQL Express Database and insert a record. In order for the VBA to connect to the SQL server, a reference to ADO was required in Visual Basic For Application. To establish that reference, in Outlook, had to click on tab DEVELOPER/VISUAL BASIC/TOOLS/REFERENCE/ and placed a check on checkbox Microsoft ActiveX Data Object 2.0 Library. Go to https://www.ouritsource.com/upl/1456990546-ado.png to see image.

Leave a Reply

Your email address will not be published. Required fields are marked *