{"id":238,"date":"2021-11-02T20:05:57","date_gmt":"2021-11-02T20:05:57","guid":{"rendered":"https:\/\/ouritsource.com\/blog\/?p=238"},"modified":"2021-11-02T20:24:30","modified_gmt":"2021-11-02T20:24:30","slug":"example-of-vba-code-running-in-outlook-2016-to-connect-to-sql-express","status":"publish","type":"post","link":"https:\/\/ouritsource.com\/blog\/example-of-vba-code-running-in-outlook-2016-to-connect-to-sql-express\/","title":{"rendered":"Example of VBA code running in Outlook 2016 to connect to SQL Express"},"content":{"rendered":"<body>\n<p>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.<\/p>\n\n\n\n<div style=\"width:100%; padding-bottom:56.25%; position:relative;\">\n  <iframe src=\"https:\/\/www.ouritsource.com\/apps\/codingexamples\/showcode.php?ref=66\" style=\"position:absolute; top:0px; left:0px; \n  width:100%; height:100%; border: none; overflow: hidden;\"><\/iframe>\n<\/div>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[24],"tags":[],"class_list":["post-238","post","type-post","status-publish","format-standard","hentry","category-vbscript","no-thumbnail"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/comments?post=238"}],"version-history":[{"count":1,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/238\/revisions"}],"predecessor-version":[{"id":239,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/238\/revisions\/239"}],"wp:attachment":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/media?parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/categories?post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/tags?post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}