{"id":11644,"date":"2022-09-26T18:50:27","date_gmt":"2022-09-26T09:50:27","guid":{"rendered":"https:\/\/prodskill.com\/?p=11644"},"modified":"2022-10-04T23:11:43","modified_gmt":"2022-10-04T14:11:43","slug":"excel-vba-coding-pattern-get-db-query-result","status":"publish","type":"post","link":"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/","title":{"rendered":"VBA Coding Pattern: Importing DB Query Results to Excel"},"content":{"rendered":"\n<p>DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 \ub97c \uad6c\ud604\ud558\ub294 VBA \ucf54\ub529 \ud328\ud134\uc744 \uc18c\uac1c\ud55c\ub2e4.<\/p>\n\n\n\n<p>\uad00\ub828\uae00: <a href=\"https:\/\/prodskill.com\/excel-vba-coding-pattern-ado-db-connection-string\/\">VBA \ucf54\ub529 \ud328\ud134: ADO DB Connection String \uc0dd\uc131<\/a><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">&lt;&lt;\ubaa9\ucc28&gt;&gt;<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/#1_%EC%97%91%EC%85%80_%ED%99%94%EB%A9%B4%EA%B3%BC_%EB%8F%99%EC%9E%91_%EB%B0%A9%EC%8B%9D\" >1. \uc5d1\uc140 \ud654\uba74\uacfc \ub3d9\uc791 \ubc29\uc2dd<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/#11_%EC%97%91%EC%85%80_%ED%99%94%EB%A9%B4\" >1.1. \uc5d1\uc140 \ud654\uba74<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/#12_DB_Query_%EA%B2%B0%EA%B3%BC_%EC%97%91%EC%85%80%EB%A1%9C_%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0_%EB%8F%99%EC%9E%91_%EB%B0%A9%EC%8B%9D\" >1.2. DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 \ub3d9\uc791 \ubc29\uc2dd<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/#2_DB_%EC%A0%91%EC%86%8D%EC%9D%84_%EC%9C%84%ED%95%9C_Provider%EA%B3%B5%EA%B8%89%EC%9E%90_%EC%84%A0%ED%83%9D\" >2. DB \uc811\uc18d\uc744 \uc704\ud55c Provider(\uacf5\uae09\uc790) \uc120\ud0dd<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/#ConnectionString_%EC%83%9D%EC%84%B1_%EB%B0%A9%EB%B2%95_1_UDL_%ED%8C%8C%EC%9D%BC_%EC%9D%B4%EC%9A%A9\" >ConnectionString \uc0dd\uc131 \ubc29\ubc95 1. UDL \ud30c\uc77c \uc774\uc6a9<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/#ConnectionString_%EC%83%9D%EC%84%B1_%EB%B0%A9%EB%B2%95_2_VBA_%EC%BD%94%EB%93%9C\" >ConnectionString \uc0dd\uc131 \ubc29\ubc95 2. VBA \ucf54\ub4dc<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/#Provider_%EA%B4%80%EB%A0%A8_%EC%A3%BC%EC%9D%98%EC%82%AC%ED%95%AD\" >Provider \uad00\ub828 \uc8fc\uc758\uc0ac\ud56d<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/#3_DB_Query_%EA%B2%B0%EA%B3%BC_%EC%97%91%EC%85%80%EB%A1%9C_%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0_%EA%B5%AC%ED%98%84\" >3. DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 \uad6c\ud604<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/#31_%EC%B0%B8%EC%A1%B0_%EC%B6%94%EA%B0%80\" >3.1. \ucc38\uc870 \ucd94\uac00<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/#32_DB_Query_%EA%B2%B0%EA%B3%BC_%EC%97%91%EC%85%80%EB%A1%9C_%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0_VBA_%EC%BD%94%EB%93%9C\" >3.2. DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 VBA \ucf54\ub4dc<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/#33_%EC%98%88%EC%8B%9C_%ED%8C%8C%EC%9D%BC_%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C\" >3.3. \uc608\uc2dc \ud30c\uc77c \ub2e4\uc6b4\ub85c\ub4dc<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"1._\uc5d1\uc140_\ud654\uba74\uacfc_\ub3d9\uc791_\ubc29\uc2dd\"><span class=\"ez-toc-section\" id=\"1_%EC%97%91%EC%85%80_%ED%99%94%EB%A9%B4%EA%B3%BC_%EB%8F%99%EC%9E%91_%EB%B0%A9%EC%8B%9D\"><\/span>1. \uc5d1\uc140 \ud654\uba74\uacfc \ub3d9\uc791 \ubc29\uc2dd<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1.1._\uc5d1\uc140_\ud654\uba74\"><span class=\"ez-toc-section\" id=\"11_%EC%97%91%EC%85%80_%ED%99%94%EB%A9%B4\"><\/span>1.1. \uc5d1\uc140 \ud654\uba74<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>&#8220;B1&#8243;\uc140\uc5d0 DB\uc5d0 \uc5f0\uacb0\ud558\uae30 \uc704\ud55c \uc5f0\uacb0 \ubb38\uc790\uc5f4(Connection String)\uc744 \uc785\ub825\ud558\uace0, &#8220;B2&#8243;\uc140\uc5d0 \ub370\uc774\ud130\ub97c \ucd94\ucd9c\ud558\uae30 \uc704\ud55c SQL Query\ub97c \uc785\ub825\ud558\ub3c4\ub85d \uad6c\uc131\ud55c\ub2e4.<\/p>\n\n\n\n<p>&#8220;\uac1c\ubc1c\ub3c4\uad6c &gt; \uc0bd\uc785 &gt; ActiveX \ucee8\ud2b8\ub864 &gt; \uba85\ub839\ub2e8\ucd94&#8221;\ub97c \ud074\ub9ad\ud558\uc5ec \ubc84\ud2bc\uc744 \ucd94\uac00\ud558\uace0, \uc774\ub984\uc744 &#8220;Query\uc2e4\ud589&#8221;\uc73c\ub85c \ubcc0\uacbd\ud55c\ub2e4.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-188.png\"><img loading=\"lazy\" decoding=\"async\" width=\"207\" height=\"303\" src=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-188.png\" alt=\"Excel \uba85\ub839 \ub2e8\ucd94 \ucd94\uac00\" class=\"wp-image-11645\" srcset=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-188.png 207w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-188-205x300.png 205w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-188-8x12.png 8w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-188-16x24.png 16w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-188-25x36.png 25w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-188-33x48.png 33w\" sizes=\"auto, (max-width: 207px) 100vw, 207px\" \/><\/a><figcaption>Excel \uba85\ub839 \ub2e8\ucd94 \ucd94\uac00<\/figcaption><\/figure>\n<\/div>\n\n\n<p>\uc608\uc2dc \ud654\uba74\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-189.png\"><img loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"374\" src=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-189.png\" alt=\"DB Query \ud654\uba74 \uad6c\uc131\" class=\"wp-image-11646\" srcset=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-189.png 697w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-189-300x161.png 300w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-189-18x10.png 18w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-189-24x13.png 24w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-189-36x19.png 36w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-189-48x26.png 48w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/a><figcaption>DB Query \ud654\uba74 \uad6c\uc131<\/figcaption><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"1.2._\ub3d9\uc791_\ubc29\uc2dd\"><span class=\"ez-toc-section\" id=\"12_DB_Query_%EA%B2%B0%EA%B3%BC_%EC%97%91%EC%85%80%EB%A1%9C_%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0_%EB%8F%99%EC%9E%91_%EB%B0%A9%EC%8B%9D\"><\/span><br>1.2. DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 \ub3d9\uc791 \ubc29\uc2dd<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png\"><img loading=\"lazy\" decoding=\"async\" width=\"543\" height=\"512\" src=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png\" alt=\"DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 \ub3d9\uc791 \ubc29\uc2dd\" class=\"wp-image-11647\" srcset=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png 543w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190-300x283.png 300w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190-13x12.png 13w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190-24x24.png 24w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190-36x34.png 36w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190-48x45.png 48w\" sizes=\"auto, (max-width: 543px) 100vw, 543px\" \/><\/a><figcaption>DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 \ub3d9\uc791 \ubc29\uc2dd<\/figcaption><\/figure>\n<\/div>\n\n\n<p>\uc704 \uadf8\ub9bc\uacfc \uac19\uc740 \ubc29\uc2dd\uc73c\ub85c \ub3d9\uc791\ud55c\ub2e4.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\uc5d1\uc140\uc5d0 \ucd94\uac00\ud55c &#8220;Query \uc2e4\ud589&#8221; \ubc84\ud2bc \ud074\ub9ad<\/li><li>VBA \ucf54\ub4dc\uc5d0\uc11c DB \uc5f0\uacb0<\/li><li>\uc5f0\uacb0\ud55c DB\uc5d0\uc11c Query \uc2e4\ud589<\/li><li>DB\uc5d0\uc11c \uc2e4\ud589\ud55c Query \uacb0\uacfc \ubc18\ud658<\/li><li>\uc5d1\uc140 \uc2dc\ud2b8\uc5d0 Query \uacb0\uacfc \ud45c\uc2dc<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2._DB_\uc811\uc18d\uc744_\uc704\ud55c_Provider(\uacf5\uae09\uc790)_\uc120\ud0dd\"><span class=\"ez-toc-section\" id=\"2_DB_%EC%A0%91%EC%86%8D%EC%9D%84_%EC%9C%84%ED%95%9C_Provider%EA%B3%B5%EA%B8%89%EC%9E%90_%EC%84%A0%ED%83%9D\"><\/span>2. DB \uc811\uc18d\uc744 \uc704\ud55c Provider(\uacf5\uae09\uc790) \uc120\ud0dd<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\uc704 \ub3d9\uc791\ubc29\uc2dd\uc758 &#8220;2. VBA \ucf54\ub4dc\uc5d0\uc11c DB \uc5f0\uacb0&#8221;\uc5d0\uc11c \uc0ac\uc6a9\ud558\ub294 \uacf5\uae09\uc790\uc774\ub2e4. ADO.Connection \uac1c\uccb4\uc758 Provider \uc18d\uc131\uc73c\ub85c \uc9c0\uc815\ud558\uac70\ub098, ConnectionString\uc73c\ub85c \uc9c0\uc815\ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<p>\ubcf4\ud1b5\uc740 ConnectionString\uc73c\ub85c \uc9c0\uc815\ud558\uace0, \uadf8 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>MS OLE DB Provider for ODBC Drivers<ul><li>Provider=MSDASQL.1; Password=[\ube44\ubc00\ubc88\ud638]; Persist Security Info=True; User ID=[UserID]; Data Source=[ODBC \uc81c\uc5b4\ud310\uc5d0\uc11c \uc124\uc815\ud55c DSN]; Initial Catalog=[DB\uba85]<\/li><\/ul><\/li><li>MS OLE DB for SQL Server (SQL Server \uc778\uc99d)<ul><li>Provider=SQLOLEDB.1; Password=[\ube44\ubc00\ubc88\ud638]; Persist Security Info=True; User ID=[UserID]; Initial Catalog=[DB\uba85];Data Source=[\uc11c\ubc84\uc8fc\uc18c(IP \ub610\ub294 host\uba85)]<\/li><\/ul><\/li><li>MS OLE DB for SQL Server (Windows \uc778\uc99d)<ul><li>Provider=SQLOLEDB.1; Password=[\ube44\ubc00\ubc88\ud638];&nbsp;Integrated Security=SSPI; Persist Security Info=False; User ID=[UserID]; Initial Catalog=[DB\uba85];Data Source=[\uc11c\ubc84\uc8fc\uc18c(IP \ub610\ub294 host\uba85)]<\/li><\/ul><\/li><li>Oracle Provider for OLE DB<ul><li>Provider=OraOLEDB.Oracle.1;Password=[\ube44\ubc00\ubc88\ud638]; Persist Security Info=True; User ID=[UserID]; Data Source=[\uc11c\ubc84\uc8fc\uc18c(IP \ub610\ub294 host\uba85)]<\/li><\/ul><\/li><\/ul>\n\n\n\n<p>PC\uc5d0 \uc801\ud569\ud55c Provider(\uacf5\uae09\uc790)\uac00 \uc124\uce58\ub418\uc5b4 \uc788\ub2e4\uba74, Oracle, MS SQL Server, MySQL, MariaDB, PostgreSQL \ub4f1\uc758 RDBMS \uc11c\ubc84\uc5d0 \uc811\uc18d\ud560 \uc218 \uc788\uace0, MS Access, SQLite \ub4f1\uc758 local RDBMS\uc5d0\ub3c4 \uc811\uc18d\ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<p>ConnectionString\uc740 \ub2e4\uc74c\uacfc \uac19\uc740 \ubc29\ubc95\uc73c\ub85c \uc0dd\uc131\ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"ConnectionString_\uc0dd\uc131_\ubc29\ubc95_1._UDL_\ud30c\uc77c_\uc774\uc6a9\"><span class=\"ez-toc-section\" id=\"ConnectionString_%EC%83%9D%EC%84%B1_%EB%B0%A9%EB%B2%95_1_UDL_%ED%8C%8C%EC%9D%BC_%EC%9D%B4%EC%9A%A9\"><\/span>ConnectionString \uc0dd\uc131 \ubc29\ubc95 1. UDL \ud30c\uc77c \uc774\uc6a9<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>UDL(Universal Data Link) \ud30c\uc77c\uc740 Microsoft Data Access Components(MDAC)\uc5d0 \ud3ec\ud568\ub41c \uac1c\ub150\uc774\ub2e4.<\/p>\n\n\n\n<p>\ucc38\uace0:&nbsp;<a href=\"https:\/\/docs.microsoft.com\/ko-kr\/sql\/connect\/oledb\/help-topics\/data-link-pages?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener\">UDL(\uc720\ub2c8\ubc84\uc124 \ub370\uc774\ud130 \ub9c1\ud06c) \uad6c\uc131 &#8211; OLE DB Driver for SQL Server | Microsoft Docs<\/a><\/p>\n\n\n\n<p>\ub2e4\uc74c \uc808\ucc28\ub85c \uc2e4\ud589\ud55c\ub2e4.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\ubc14\ud0d5\ud654\uba74\uc5d0\uc11c \ub9c8\uc6b0\uc2a4 \uc6b0\uce21 \ubc84\ud2bc \ud074\ub9ad &gt; \uc0c8\ub85c \ub9cc\ub4e4\uae30 &gt; \ud14d\uc2a4\ud2b8 \ubb38\uc11c<\/li><li>\ud30c\uc77c\uba85\uc744 test.udl\ub85c \ubcc0\uacbd\ud558\uace0 \uc5d4\ud130<\/li><li>test.udl \ud30c\uc77c\uc744 \ub354\ube14\ud074\ub9ad\ud558\uc5ec \uc5f4\uace0 &#8220;\uacf5\uae09\uc790&#8221; \ud0ed\uc5d0\uc11c \uacf5\uae09\uc790 \uc120\ud0dd\ud6c4 &#8220;\uc5f0\uacb0&#8221; \ud0ed\uc5d0\uc11c \uc11c\ubc84, \uc0ac\uc6a9\uc790 \uc774\ub984, \uc554\ud638, \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ub4f1\uc744 \uc785\ub825\ud6c4 &#8220;\uc5f0\uacb0 \ud14c\uc2a4\ud2b8&#8221;\ud55c \ub2e4\uc74c &#8220;\ud655\uc778&#8221;\ud558\uc5ec \uc800\uc7a5<\/li><li>\uc800\uc7a5\ud55c test.udl \ud30c\uc77c\uc744 \ud3b8\uc9d1\uae30(\uba54\ubaa8\uc7a5 \ub4f1)\ub85c \uc5f4\uc5b4 \ubcf4\uba74 ConnectionString\uc744 \uc5bb\uc744 \uc218 \uc788\uc74c<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-191.png\"><img loading=\"lazy\" decoding=\"async\" width=\"427\" height=\"540\" data-id=\"11648\" src=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-191.png\" alt=\"\" class=\"wp-image-11648\" srcset=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-191.png 427w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-191-237x300.png 237w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-191-9x12.png 9w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-191-19x24.png 19w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-191-28x36.png 28w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-191-38x48.png 38w\" sizes=\"auto, (max-width: 427px) 100vw, 427px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-192.png\"><img loading=\"lazy\" decoding=\"async\" width=\"427\" height=\"540\" data-id=\"11649\" src=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-192.png\" alt=\"\" class=\"wp-image-11649\" srcset=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-192.png 427w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-192-237x300.png 237w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-192-9x12.png 9w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-192-19x24.png 19w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-192-28x36.png 28w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-192-38x48.png 38w\" sizes=\"auto, (max-width: 427px) 100vw, 427px\" \/><\/a><\/figure>\n<figcaption class=\"blocks-gallery-caption\">\ucc38\uace0: ConnectionString \uc0dd\uc131 \ubc29\ubc95 1. UDL \ud30c\uc77c \uc774\uc6a9<\/figcaption><\/figure>\n\n\n\n<p>\uc774 \ubc29\ubc95\uc740 Windows OS\uc758 32bit, 64bit \ud50c\ub7ab\ud3fc\uc5d0 \ub530\ub77c Provider\uac00 \ud45c\uc2dc\ub41c\ub2e4. \uc989, 64bit OS\uc5d0\uc11c\ub294 64bit Provider\ub9cc \ud45c\uc2dc\ub41c\ub2e4. 64bit OS\uc5d0\uc11c 32bit Provider\ub97c \ud45c\uc2dc\ud560 \uc218 \uc788\ub294 \ubc29\ubc95\uc740 \ubcc4\ub3c4\uc758 \uae00\ub85c \ud3ec\uc2a4\ud305\ud558\uaca0\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"ConnectionString_\uc0dd\uc131_\ubc29\ubc95_2._VBA_\ucf54\ub4dc\"><span class=\"ez-toc-section\" id=\"ConnectionString_%EC%83%9D%EC%84%B1_%EB%B0%A9%EB%B2%95_2_VBA_%EC%BD%94%EB%93%9C\"><\/span>ConnectionString \uc0dd\uc131 \ubc29\ubc95 2. VBA \ucf54\ub4dc<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\uc774\uc804 \uae00&nbsp;<a href=\"https:\/\/prodskill.com\/excel-vba-coding-pattern-ado-db-connection-string\/\">VBA \ucf54\ub529 \ud328\ud134: ADO DB Connection String \uc0dd\uc131<\/a> \uc5d0\uc11c \uc0c1\uc138\ud558\uac8c \uc124\uba85\ud574 \ub450\uc5c8\ub2e4. \uc694\uc57d\ud558\uba74 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Microsoft&nbsp;ActiveX&nbsp;Data&nbsp;Objects&nbsp;2.8&nbsp;Library&nbsp;\ucc38\uc870&nbsp;\ucd94\uac00<\/li><li>Microsoft&nbsp;OLE&nbsp;DB&nbsp;Service&nbsp;Component&nbsp;1.0&nbsp;Type&nbsp;Library&nbsp;\ucc38\uc870&nbsp;\ucd94\uac00<\/li><li>\ub2e4\uc74c \ucf54\ub4dc\ub85c ConnectionString\uc744 \uc0dd\uc131<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"visualbasic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"15\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Private Sub btnBuildConnectionString_Click()\nOn Error GoTo 0\n\n    Dim cn As ADODB.Connection, MSDASCObj As MSDASC.DataLinks, oCurrentRange As Range\n    Dim eOrgXlEnableCancelKey As XlEnableCancelKey\n\n    Set oCurrentRange = ActiveCell\n\n    Set MSDASCObj = New MSDASC.DataLinks\n\n    eOrgXlEnableCancelKey = Application.EnableCancelKey\n    Application.EnableCancelKey = xlDisabled\n    Set cn = New ADODB.Connection\n    cn.ConnectionString = oCurrentRange\n    If MSDASCObj.PromptEdit(cn) = True Then\n        oCurrentRange = cn.ConnectionString\n    End If\n\n    Set cn = Nothing\n    Set MSDASCObj = Nothing\n\n    Application.EnableCancelKey = eOrgXlEnableCancelKey\nEnd Sub<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Provider_\uad00\ub828_\uc8fc\uc758\uc0ac\ud56d\"><span class=\"ez-toc-section\" id=\"Provider_%EA%B4%80%EB%A0%A8_%EC%A3%BC%EC%9D%98%EC%82%AC%ED%95%AD\"><\/span>Provider \uad00\ub828 \uc8fc\uc758\uc0ac\ud56d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\uc0ac\uc6a9\ud558\ub824\ub294 Provider\uc640 Excel\uc758 32bit, 64bit \ud50c\ub7ab\ud3fc\uc774 \uac19\uc544\uc57c \ud55c\ub2e4. 32bit Excel\uc744 \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 \uacbd\uc6b0\ub294 32bit Provider\ub97c \uc0ac\uc6a9\ud574\uc57c \ud558\uace0, 63bit Excel\uc744 \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 \uacbd\uc6b0\ub294 64bit Provider\ub97c \uc0ac\uc6a9\ud574\uc57c \ud55c\ub2e4.<\/p>\n\n\n\n<p>64bit Windows OS\uc640 32bit Excel\uc744 \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0\uc5d0 \uccab \ubc88\uc9f8 \ubc29\ubc95\uc73c\ub85c \uc0dd\uc131\ud55c ConnectionString\uc73c\ub85c Database\uc5f0\uacb0\ud558\ub824\uace0 \ud560 \ub54c &#8220;\uacf5\uae09\uc790\ub97c \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4&#8221;\ub77c\ub294 \uc624\ub958\uac00 \ubc1c\uc0dd\ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<p>\uc774 \uacbd\uc6b0\ub294 Excel\uacfc Provider\uc758 \ud50c\ub7ab\ud3fc\uc774 \ub3d9\uc77c\ud55c\uc9c0 \ud655\uc778\ud558\uace0 \uc801\ud569\ud55c Provider\ub97c \uc0ac\uc6a9\ud558\uba74 \ud574\uacb0\ub41c\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3._DB_Query_\uacb0\uacfc_\uc5d1\uc140\ub85c_\uac00\uc838\uc624\uae30_\uad6c\ud604\"><span class=\"ez-toc-section\" id=\"3_DB_Query_%EA%B2%B0%EA%B3%BC_%EC%97%91%EC%85%80%EB%A1%9C_%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0_%EA%B5%AC%ED%98%84\"><\/span>3. DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 \uad6c\ud604<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3.1._\ucc38\uc870_\ucd94\uac00\"><span class=\"ez-toc-section\" id=\"31_%EC%B0%B8%EC%A1%B0_%EC%B6%94%EA%B0%80\"><\/span>3.1. \ucc38\uc870 \ucd94\uac00<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>VBA \ucf54\ub4dc\ud3b8\uc9d1\uae30 \uba54\ub274\uc5d0\uc11c &#8220;\ub3c4\uad6c &gt; \ucc38\uc870\ucd94\uac00&#8221;\ub97c \uc2e4\ud589\ud558\uc5ec, &#8220;Microsoft ActiveX Data Objects 2.8 Library&#8221;\ub97c \ucc38\uc870 \ucd94\uac00\ud55c\ub2e4.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-193.png\"><img loading=\"lazy\" decoding=\"async\" width=\"524\" height=\"338\" src=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-193.png\" alt=\"Microsoft ActiveX Data Objects 2.8 Library \ucc38\uc870 \ucd94\uac00\" class=\"wp-image-11650\" srcset=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-193.png 524w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-193-300x194.png 300w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-193-18x12.png 18w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-193-24x15.png 24w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-193-36x23.png 36w, https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-193-48x31.png 48w\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" \/><\/a><figcaption>Microsoft ActiveX Data Objects 2.8 Library \ucc38\uc870 \ucd94\uac00<\/figcaption><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"3.2._DB_Query_\uacb0\uacfc_\uc5d1\uc140\ub85c_\uac00\uc838\uc624\uae30_VBA_\ucf54\ub4dc\"><span class=\"ez-toc-section\" id=\"32_DB_Query_%EA%B2%B0%EA%B3%BC_%EC%97%91%EC%85%80%EB%A1%9C_%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0_VBA_%EC%BD%94%EB%93%9C\"><\/span>3.2. DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 VBA \ucf54\ub4dc<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\uc5d1\uc140 \uc2dc\ud2b8\uc5d0 \ucd94\uac00\ud55c \ubc84\ud2bc\uc758 \ud074\ub9ad \uc774\ubca4\ud2b8 \ud504\ub85c\uc2dc\uc838\uc5d0 \ub2e4\uc74c\uacfc \uac19\uc740 \ucf54\ub4dc\ub97c \uc791\uc131\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"visualbasic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"6-7,12,15,18-22\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Private Sub cmd_RunQuery_Click()\n    Dim sSQL As String\n    Dim oCon As ADODB.Connection, oRS As ADODB.Recordset\n    Dim sConnectionString As String\n\n    sConnectionString = Range(\"B1\").Value2\n    sSQL = Range(\"B2\").Value2\n\n    Set oCon = New ADODB.Connection\n    Set oRS = New ADODB.Recordset\n    oCon.ConnectionTimeout = 10\n    oCon.Open sConnectionString\n    oCon.CommandTimeout = 60\n\n    oRS.Open sSQL, oCon, adOpenForwardOnly, adLockReadOnly\n    \n    Dim oSht As Worksheet, lColIdx As Long\n    Set oSht = Worksheets.Add(After:=Me)\n    For lColIdx = 0 To oRS.Fields.Count - 1\n        oSht.Range(\"A1\").Offset(0, lColIdx).Value2 = oRS.Fields(lColIdx).Name\n    Next lColIdx\n    oSht.Range(\"A2\").CopyFromRecordset oRS\n\n    oRS.Close: Set oRS = Nothing\n    oCon.Close: Set oCon = Nothing\nEnd Sub<\/pre>\n\n\n\n<p>\uc704 \ucf54\ub4dc\uc5d0 \ub300\ud55c \uc124\uba85\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>6\ud589: \uc5d1\uc140 \uc2dc\ud2b8\uc758 &#8220;B1&#8221; cell\uac12\uc744 sConnectionString \ubcc0\uc218\ub85c \uac00\uc838\uc628\ub2e4.<\/li><li>7\ud589:&nbsp;\uc5d1\uc140 \uc2dc\ud2b8\uc758 &#8220;B2&#8221; cell\uac12\uc744 sSQL \ubcc0\uc218\ub85c \uac00\uc838\uc628\ub2e4.<\/li><li>12\ud589: ADODB.Connection \uac1c\uccb4 oCon\uc5d0&nbsp;sConnectionString \uac12\uc744 \uc804\ub2ec\ud558\uc5ec \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \uc811\uc18d\ud55c\ub2e4.<\/li><li>15\ud589: \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0\uc11c SQL Query\ub97c \uc2e4\ud589\ud558\uace0 \uadf8 \uacb0\uacfc\ub97c ADODB.Recordset \uac1c\uccb4 oRS\ub85c \uac00\uc838\uc628\ub2e4.<\/li><li>18\ud589: SQL Query \uc2e4\ud589\uacb0\uacfc\ub97c \ud45c\uc2dc\ud560 \uc2dc\ud2b8 oSht\ub97c \uc0dd\uc131\ud55c\ub2e4.<\/li><li>19-21\ud589: \uac1c\uccb4 oRS\uc758 \ud544\ub4dc(\uceec\ub7fc) \ubaa9\ub85d\uc744 \uc2dc\ud2b8 oSht\uc758 \uccab \ubc88\uc9f8 \ud589\uc5d0 \ucd9c\ub825\ud55c\ub2e4.<\/li><li>22\ud589: oSht \uc2dc\ud2b8\uc758 &#8220;A2&#8221; \uc140\uc5d0 oRS\uc758 \ub0b4\uc6a9(SQL Query \uc2e4\ud589\uacb0\uacfc)\uc744 \ucd9c\ub825\ud55c\ub2e4.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3.3._\uc608\uc2dc_\ud30c\uc77c_\ub2e4\uc6b4\ub85c\ub4dc\"><span class=\"ez-toc-section\" id=\"33_%EC%98%88%EC%8B%9C_%ED%8C%8C%EC%9D%BC_%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C\"><\/span>3.3. \uc608\uc2dc \ud30c\uc77c \ub2e4\uc6b4\ub85c\ub4dc<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\uc544\ub798 github Link\uc5d0\uc11c \uc704\uc5d0 \uc124\uba85\ud55c \ucf54\ub4dc\uac00 \ud3ec\ud568\ub41c \uc608\uc2dc \uc5d1\uc140\ud30c\uc77c\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<br>\ud30c\uc77c Link:&nbsp;<a href=\"https:\/\/github.com\/DAToolset\/VBACode\/raw\/main\/VBA%20%EC%BD%94%EB%94%A9%20%ED%8C%A8%ED%84%B4-DB%20Query1.xlsm\" target=\"_blank\" rel=\"noreferrer noopener\">github DAToolset\/VBACode\/VBA&nbsp;\ucf54\ub529&nbsp;\ud328\ud134-DB&nbsp;Query1.xlsm<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introducing the VBA coding pattern that implements importing DB Query results to Excel. Related Article: VBA Coding Pattern: Creating ADO DB Connection String 1. Excel Screen and Operation Method 1.1. Enter the connection string to connect to the DB in cell \u201cB1\u201d of the Excel screen, and in cell \u201cB2\u201d to extract data...<\/p>","protected":false},"author":1,"featured_media":11647,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[17,73,97,98,99,100,101,102,103],"class_list":["post-11644","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel-vba-coding-pattern","tag-vba","tag-excel-vba","tag-ado","tag-connection-string","tag-db","tag-database","tag-provider","tag-udl","tag-query"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>VBA \ucf54\ub529 \ud328\ud134: DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 - \uc0dd\uc0b0\uc131 Skill<\/title>\n<meta name=\"description\" content=\"DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 \ub97c \uad6c\ud604\ud558\ub294 VBA \ucf54\ub529 \ud328\ud134\uc744 \uc18c\uac1c\ud55c\ub2e4. \ub3d9\uc791 \ubc29\uc2dd\uacfc DB \uc811\uc18d\uc744 \uc704\ud55c Provider(\uacf5\uae09\uc790) \uc120\ud0dd, Provider \uad00\ub828 \uc8fc\uc758\uc0ac\ud56d, \uc18c\uc2a4\ucf54\ub4dc\ub97c \ud655\uc778\ud560 \uc218 \uc788\uace0, \uc608\uc2dc \ud30c\uc77c\uc744 \ub2e4\uc6b4\ub85c\ub4dc \ubc1b\uc744 \uc218 \uc788\ub2e4.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VBA \ucf54\ub529 \ud328\ud134: DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 - \uc0dd\uc0b0\uc131 Skill\" \/>\n<meta property=\"og:description\" content=\"DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 \ub97c \uad6c\ud604\ud558\ub294 VBA \ucf54\ub529 \ud328\ud134\uc744 \uc18c\uac1c\ud55c\ub2e4. \ub3d9\uc791 \ubc29\uc2dd\uacfc DB \uc811\uc18d\uc744 \uc704\ud55c Provider(\uacf5\uae09\uc790) \uc120\ud0dd, Provider \uad00\ub828 \uc8fc\uc758\uc0ac\ud56d, \uc18c\uc2a4\ucf54\ub4dc\ub97c \ud655\uc778\ud560 \uc218 \uc788\uace0, \uc608\uc2dc \ud30c\uc77c\uc744 \ub2e4\uc6b4\ub85c\ub4dc \ubc1b\uc744 \uc218 \uc788\ub2e4.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/\" \/>\n<meta property=\"og:site_name\" content=\"\uc0dd\uc0b0\uc131 Skill\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-26T09:50:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-04T14:11:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png\" \/>\n\t<meta property=\"og:image:width\" content=\"543\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Zerom\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Zerom\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/\"},\"author\":{\"name\":\"Zerom\",\"@id\":\"https:\/\/prodskill.com\/ko\/#\/schema\/person\/bbad0870c78008c82edbe0960fe768bd\"},\"headline\":\"VBA \ucf54\ub529 \ud328\ud134: DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30\",\"datePublished\":\"2022-09-26T09:50:27+00:00\",\"dateModified\":\"2022-10-04T14:11:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/\"},\"wordCount\":325,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/prodskill.com\/ko\/#\/schema\/person\/bbad0870c78008c82edbe0960fe768bd\"},\"image\":{\"@id\":\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png\",\"keywords\":[\"\uc5d1\uc140VBA\",\"Excel VBA\",\"ADO\",\"Connection String\",\"DB\",\"Database\",\"Provider\",\"UDL\",\"Query\"],\"articleSection\":[\"\uc5d1\uc140 VBA \ucf54\ub529\ud328\ud134\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/\",\"url\":\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/\",\"name\":\"VBA \ucf54\ub529 \ud328\ud134: DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 - \uc0dd\uc0b0\uc131 Skill\",\"isPartOf\":{\"@id\":\"https:\/\/prodskill.com\/ko\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png\",\"datePublished\":\"2022-09-26T09:50:27+00:00\",\"dateModified\":\"2022-10-04T14:11:43+00:00\",\"description\":\"DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 \ub97c \uad6c\ud604\ud558\ub294 VBA \ucf54\ub529 \ud328\ud134\uc744 \uc18c\uac1c\ud55c\ub2e4. \ub3d9\uc791 \ubc29\uc2dd\uacfc DB \uc811\uc18d\uc744 \uc704\ud55c Provider(\uacf5\uae09\uc790) \uc120\ud0dd, Provider \uad00\ub828 \uc8fc\uc758\uc0ac\ud56d, \uc18c\uc2a4\ucf54\ub4dc\ub97c \ud655\uc778\ud560 \uc218 \uc788\uace0, \uc608\uc2dc \ud30c\uc77c\uc744 \ub2e4\uc6b4\ub85c\ub4dc \ubc1b\uc744 \uc218 \uc788\ub2e4.\",\"breadcrumb\":{\"@id\":\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#primaryimage\",\"url\":\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png\",\"contentUrl\":\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png\",\"width\":543,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/prodskill.com\/ko\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VBA \ucf54\ub529 \ud328\ud134: DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/prodskill.com\/ko\/#website\",\"url\":\"https:\/\/prodskill.com\/ko\/\",\"name\":\"\uc0dd\uc0b0\uc131 Skill\",\"description\":\"Meta Thinking, Meta Working\",\"publisher\":{\"@id\":\"https:\/\/prodskill.com\/ko\/#\/schema\/person\/bbad0870c78008c82edbe0960fe768bd\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/prodskill.com\/ko\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/prodskill.com\/ko\/#\/schema\/person\/bbad0870c78008c82edbe0960fe768bd\",\"name\":\"Zerom\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/productivity_clockgear.png\",\"url\":\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/productivity_clockgear.png\",\"contentUrl\":\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/productivity_clockgear.png\",\"width\":512,\"height\":512,\"caption\":\"Zerom\"},\"logo\":{\"@id\":\"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/productivity_clockgear.png\"},\"url\":\"https:\/\/prodskill.com\/en\/author\/proda\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"VBA Coding Pattern: Importing DB Query Results into Excel - Productivity Skill","description":"This article introduces a VBA coding pattern for importing DB query results into Excel. You can learn how it works, select a provider for DB access, take note of provider-related considerations, review the source code, and download example files.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/","og_locale":"en_US","og_type":"article","og_title":"VBA \ucf54\ub529 \ud328\ud134: DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 - \uc0dd\uc0b0\uc131 Skill","og_description":"DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30 \ub97c \uad6c\ud604\ud558\ub294 VBA \ucf54\ub529 \ud328\ud134\uc744 \uc18c\uac1c\ud55c\ub2e4. \ub3d9\uc791 \ubc29\uc2dd\uacfc DB \uc811\uc18d\uc744 \uc704\ud55c Provider(\uacf5\uae09\uc790) \uc120\ud0dd, Provider \uad00\ub828 \uc8fc\uc758\uc0ac\ud56d, \uc18c\uc2a4\ucf54\ub4dc\ub97c \ud655\uc778\ud560 \uc218 \uc788\uace0, \uc608\uc2dc \ud30c\uc77c\uc744 \ub2e4\uc6b4\ub85c\ub4dc \ubc1b\uc744 \uc218 \uc788\ub2e4.","og_url":"https:\/\/prodskill.com\/en\/excel-vba-coding-pattern-get-db-query-result\/","og_site_name":"\uc0dd\uc0b0\uc131 Skill","article_published_time":"2022-09-26T09:50:27+00:00","article_modified_time":"2022-10-04T14:11:43+00:00","og_image":[{"width":543,"height":512,"url":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png","type":"image\/png"}],"author":"Zerom","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Zerom","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#article","isPartOf":{"@id":"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/"},"author":{"name":"Zerom","@id":"https:\/\/prodskill.com\/ko\/#\/schema\/person\/bbad0870c78008c82edbe0960fe768bd"},"headline":"VBA \ucf54\ub529 \ud328\ud134: DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30","datePublished":"2022-09-26T09:50:27+00:00","dateModified":"2022-10-04T14:11:43+00:00","mainEntityOfPage":{"@id":"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/"},"wordCount":325,"commentCount":2,"publisher":{"@id":"https:\/\/prodskill.com\/ko\/#\/schema\/person\/bbad0870c78008c82edbe0960fe768bd"},"image":{"@id":"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#primaryimage"},"thumbnailUrl":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png","keywords":["\uc5d1\uc140VBA","Excel VBA","ADO","Connection String","DB","Database","Provider","UDL","Query"],"articleSection":["\uc5d1\uc140 VBA \ucf54\ub529\ud328\ud134"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/","url":"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/","name":"VBA Coding Pattern: Importing DB Query Results into Excel - Productivity Skill","isPartOf":{"@id":"https:\/\/prodskill.com\/ko\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#primaryimage"},"image":{"@id":"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#primaryimage"},"thumbnailUrl":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png","datePublished":"2022-09-26T09:50:27+00:00","dateModified":"2022-10-04T14:11:43+00:00","description":"This article introduces a VBA coding pattern for importing DB query results into Excel. You can learn how it works, select a provider for DB access, take note of provider-related considerations, review the source code, and download example files.","breadcrumb":{"@id":"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#primaryimage","url":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png","contentUrl":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/image-190.png","width":543,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/prodskill.com\/excel-vba-coding-pattern-get-db-query-result\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prodskill.com\/ko\/"},{"@type":"ListItem","position":2,"name":"VBA \ucf54\ub529 \ud328\ud134: DB Query \uacb0\uacfc \uc5d1\uc140\ub85c \uac00\uc838\uc624\uae30"}]},{"@type":"WebSite","@id":"https:\/\/prodskill.com\/ko\/#website","url":"https:\/\/prodskill.com\/ko\/","name":"Productivity Skills","description":"Meta Thinking, Meta Working","publisher":{"@id":"https:\/\/prodskill.com\/ko\/#\/schema\/person\/bbad0870c78008c82edbe0960fe768bd"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prodskill.com\/ko\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/prodskill.com\/ko\/#\/schema\/person\/bbad0870c78008c82edbe0960fe768bd","name":"Zerom","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/productivity_clockgear.png","url":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/productivity_clockgear.png","contentUrl":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/productivity_clockgear.png","width":512,"height":512,"caption":"Zerom"},"logo":{"@id":"https:\/\/prodskill.com\/wp-content\/uploads\/2022\/09\/productivity_clockgear.png"},"url":"https:\/\/prodskill.com\/en\/author\/proda\/"}]}},"_links":{"self":[{"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/posts\/11644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/comments?post=11644"}],"version-history":[{"count":0,"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/posts\/11644\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/media\/11647"}],"wp:attachment":[{"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/media?parent=11644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/categories?post=11644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prodskill.com\/en\/wp-json\/wp\/v2\/tags?post=11644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}