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.