{"id":3112,"date":"2022-10-19T19:42:40","date_gmt":"2022-10-19T10:42:40","guid":{"rendered":"http:\/\/anada.cloudfree.jp\/?p=3112"},"modified":"2022-10-19T19:42:40","modified_gmt":"2022-10-19T10:42:40","slug":"access%e8%a6%9a%e6%9b%b8-%e5%bc%95%e6%95%b0%e3%82%92%e5%bc%95%e3%81%8d%e6%b8%a1%e3%81%97%e3%81%a6%e8%b5%b7%e5%8b%95","status":"publish","type":"post","link":"http:\/\/anada.cloudfree.jp\/?p=3112","title":{"rendered":"Access\u899a\u66f8 \u5f15\u6570\u3092\u5f15\u304d\u6e21\u3057\u3066\u8d77\u52d5"},"content":{"rendered":"<p>Access\u8d77\u52d5\u6642\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u5f15\u304d\u6e21\u3057\u3001<br \/>\n\u6e21\u3055\u308c\u305f\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u3063\u3066\u51e6\u7406\u3092\u304b\u3048\u308b\u65b9\u6cd5\u3002<\/p>\n<p>\u8d77\u52d5\u30b9\u30a4\u30c3\u30c1\u3068\u3044\u3046\u306e\u304c\u3042\u308b\u3089\u3057\u3044\u3002<\/p>\n<p>\u53c2\u7167\uff1a<a href=\"https:\/\/support.microsoft.com\/ja-jp\/office\/microsoft-office-\u88fd\u54c1\u306e\u30b3\u30de\u30f3\u30c9-\u30e9\u30a4\u30f3-\u30b9\u30a4\u30c3\u30c1-079164cd-4ef5-4178-b235-441737deb3a6#Category=Access\" rel=\"noopener\" target=\"_blank\">Microsoft Office \u88fd\u54c1\u306e\u30b3\u30de\u30f3\u30c9 \u30e9\u30a4\u30f3 \u30b9\u30a4\u30c3\u30c1<\/a><\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n&quot;C:\u00a5.........\u00a5MSACCESS.EXE&quot; &quot;......accdb&quot; \/cmd &quot;para1&quot; &quot;para2&quot; &quot;para3&quot; ...\r\n<\/pre>\n<p>\u9806\u306b<br \/>\n<strong>Access\u306eexe \u8d77\u52d5\u3059\u308bAccess\u30d5\u30a1\u30a4\u30eb \/cmd \u30d1\u30e9\u30e1\u30fc\u30bf\uff08\u5fc5\u8981\u5206\uff09<\/strong><br \/>\n\u3092\u305d\u308c\u305e\u308c\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u62ec\u3063\u3066\u8a2d\u5b9a\u3059\u308b\u306e\u304c\u91cd\u8981\u3089\u3057\u3044\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001Access\u5074\u306eVBA\u306f\u3053\u306e\u5f15\u6570\u3092\u5f15\u304d\u53d6\u3063\u3066\u51e6\u7406\u3092\u884c\u3046\u3002<\/p>\n<p>Command\u95a2\u6570<br \/>\n\u53c2\u7167\uff1a<a href=\"https:\/\/support.microsoft.com\/ja-jp\/office\/command-\u95a2\u6570-fec67826-7fd7-48ed-a7aa-479c020ffaa4\" rel=\"noopener\" target=\"_blank\">Microsoft Support Command\u95a2\u6570<\/a><\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u6e21\u3055\u308c\u305f\u6587\u5b57\u5217\u306f\u3001AutoExec\u30de\u30af\u30ed\u5185\u3067\u51e6\u7406\u3092\u3059\u308b\u3053\u3068\u306b\u3059\u308b\u3002<\/p>\n<ol>\n<li> \u30de\u30af\u30ed\u3092\u8ffd\u52a0 \u540d\u79f0\u306f\u300cAutoExec\u300d\u306b\u3059\u308b<\/li>\n<li> \u4f5c\u3063\u305f\u30de\u30af\u30ed\u306b\u300c\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u5b9f\u884c\u300d\u3092\u8ffd\u52a0\u3057\u30013.\u3067\u4f5c\u6210\u3059\u308bFunction\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u540d\u3092\u8a18\u8f09\u3059\u308b<\/li>\n<p>\u3000\u3000ex) RunProc()                    \u2190 \u5fc5\u305a()\u3092\u3064\u3051\u308b<\/p>\n<li> \u3053\u3053\u304b\u3089VBA<\/li>\n<p>   \u6a19\u6e96\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8ffd\u52a0\u3057\u3066\u30012.\u306e\u30de\u30af\u30ed\u3067\u5b9f\u884c\u3055\u305b\u308bFunction\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u3092\u8ffd\u52a0\u3059\u308b<br \/>\n\u3000\u3000ex) Function RunProc()  &#8230;. End Function<br \/>\n   <strong>Function\u3067\u306a\u3044\u3068\u30c0\u30e1\u3067\u3001Sub\u3060\u3068Command\u3092\u8a8d\u8b58\u3057\u306a\u304b\u3063\u305f\u3002<\/strong><\/p>\n<li> 3.\u306eFunction\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u5185\u306b\u5f15\u6570\u3092\u4f7f\u3063\u305f\u51e6\u7406\u3092\u8a18\u8f09\u3059\u308b<\/li>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n   Function RunProc()\r\n       ' Trim\u3092\u5fd8\u308c\u305a\u306b.\u3053\u308c\u306f\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u8907\u6570\u306e\u6642\u306a\u306e\u30671\u3064\u3057\u304b\u306a\u3044\u6642\u306f\u3001Trim(Command())\u3067OK\r\n       Dim cmd() As String\r\n       cmd = Split(Trim(Command()), &quot; &quot;)     \r\n       ' 1\u3064\u3081\u306e\u5f15\u6570\u3067\u51e6\u7406\u3092\u5206\u5c90\r\n       Select Case cmd(0)\r\n       Case &quot;para1&quot;\r\n          ' \u3053\u3053\u306b\u51e6\u7406\r\n       Case &quot;paraX&quot;\r\n          ' \u3053\u3053\u306b\u51e6\u7406\r\n       Case Else\r\n          ' \u3053\u3053\u306b\u51e6\u7406\r\n       End Select\r\n   End Function\r\n<\/pre>\n<\/ol>\n<p><strong>\uff1c\u6ce8\u610f\u70b9\uff1e<\/strong><br \/>\nCommand\u95a2\u6570\u306e\u7d50\u679c\u306f\u5fc5\u305aTrim\u3059\u308b\u3053\u3068\u3002\u8d77\u52d5\u30b3\u30de\u30f3\u30c9\u3067&#8221;&#8221;\u3067\u62ec\u3063\u3066\u3044\u308b\u304c\u5f8c\u308d\u306b\u30b9\u30da\u30fc\u30b9\u304c\u5165\u3063\u3066\u6e21\u3063\u3066\u304f\u308b\u3002<\/p>\n<p>\u8d77\u52d5\u30b3\u30de\u30f3\u30c9\u3067\u6700\u521d\u306bexe\u3092\u6307\u5b9a\u3057\u305f\u304f\u306a\u3044\u3001\u30e9\u30f3\u30bf\u30a4\u30e0\u8d77\u52d5\u3067\u3082\u554f\u984c\u306a\u3044\u3001\u3068\u3044\u3046\u5834\u5408\u306f\u3001<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n&quot;......accdb&quot; \/runtime \/cmd &quot;para1&quot; &quot;para2&quot; &quot;para3&quot; ...\r\n<\/pre>\n<p>\u3068\u3001\/runtime\u3092\u631f\u3080\u3068\u3001exe\u306e\u6307\u5b9a\u3092\u305b\u305a\u306bCommand\u304c\u5f15\u304d\u6e21\u3055\u308c\u3001\u51e6\u7406\u304c\u8d70\u308b\u3002<\/p>\n<hr>\n<p>\u3093\u3067\u3001\u6b21\u3002<br \/>\n\u3082\u3046\uff11\u3064\u5225\u306e\u3084\u308a\u65b9\u304c\u3042\u308b\u306e\u3060\u304c\u3001\u305d\u308c\u306f <big><strong>\/x<\/strong><\/big> \u30b9\u30a4\u30c3\u30c1\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n&quot;......accdb&quot; \/runtime \/x &quot;macro1&quot; \/cmd &quot;para1&quot; &quot;para2&quot; &quot;para3&quot; ...\r\n<\/pre>\n<p>\u3068\u3044\u3046\u611f\u3058\u306b\u3059\u308b\u3068\u3001<br \/>\n\/x \u306e\u5f8c\u308d\u306b\u5165\u308c\u305f\u30de\u30af\u30ed\u300cmacro1\u300d\u3092\u5b9f\u884c\u3055\u305b\u3089\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u3002<br \/>\n\u3067\u3001\u3055\u3063\u304d\u3068\u540c\u3058\u304f\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306e\u5b9f\u884c\u3092\u30de\u30af\u30ed\u306b\u8ffd\u52a0\u3057\u3066\u3001\u5b9f\u884c\u3055\u305b\u308bFunction\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u3092\u6307\u5b9a\u3059\u308b\u3002<br \/>\nVBA\u5074\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3057\u3066\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3093\u3067\u304a\u3051\u3070\u3044\u3044\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n   Function RunMacro1()\r\n       Dim cmd() As String\r\n       cmd = Split(Trim(Command()), &quot; &quot;)\r\n       ' \u3053\u3053\u306b\u51e6\u7406\r\n   End Function\r\n<\/pre>\n<p>\u3053\u306e\u3084\u308a\u65b9\u3060\u3068\u3001\u308f\u3056\u308f\u3056\u5206\u5c90\u51e6\u7406\u3092\u66f8\u304f\u5fc5\u8981\u304c\u306a\u3044\u306e\u3067\u3001\u898b\u305f\u76ee\u304c\u826f\u3044\u304b\u306a\u3068\u601d\u3063\u305f\u308a\u3059\u308b\u3002<\/p>\n<hr>\n<p>\u3055\u3066\u3001\u6700\u5f8c\u3002<br \/>\n\u8d77\u52d5\u30b3\u30de\u30f3\u30c9\u304b\u3089\u30e9\u30f3\u30bf\u30a4\u30e0\u5b9f\u884c(\/runtime \u4ed8)\u3055\u305b\u305f\u3068\u304d\u306b\u3001AutoExec\u306f\u8d70\u3089\u305b\u305f\u304f\u306a\u3044\u306a\u3041\u3063\u3066\u601d\u3063\u305f\u3089\u3001<br \/>\nAutoExec\u3067\u52d5\u304fFunction(\u307e\u305f\u306fSub)\u5185\u306e\u5148\u982d\u306b\u3001\u3053\u3046\u3044\u30461\u6587\u3092\u5148\u982d\u306b\u5165\u308c\u3066\u304a\u304f\u3068\u3044\u3044\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nIf SysCmd(acSysCmdRuntime) Then Exit Function\r\n<\/pre>\n<p>\u666e\u901a\u306b\u8d77\u52d5\u3055\u305b\u305f\u3068\u304d\u306f\u5f8c\u7d9a\u51e6\u7406\u304c\u8d70\u308b\u304c\u3001\u30e9\u30f3\u30bf\u30a4\u30e0\u8d77\u52d5\u3055\u305b\u305f\u3068\u304d\u306f\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u3092\u629c\u3051\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f\u3053\u3068\u3082\u3067\u304d\u308b\u308f\u3051\u3060\u3002<\/p>\n<p>\u5965\u304c\u6df1\u3044\u305c\u3001Access\u3055\u3093\u3088\u3049<\/p>\n<p>\u203b\u30e9\u30f3\u30bf\u30a4\u30e0\uff1aAccess\u304b\u3089\u958b\u767a\u6a5f\u80fd\uff08\u30d5\u30a9\u30fc\u30e0\u3001\u30af\u30a8\u30ea\u3001\u30ec\u30dd\u30fc\u30c8\u3001VBA\u306e\u4f5c\u6210\u7de8\u96c6\u6a5f\u80fd\uff09\u3092\u9664\u3044\u305f\u3082\u306e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Access\u8d77\u52d5\u6642\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u5f15\u304d\u6e21\u3057\u3001 \u6e21\u3055\u308c\u305f\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u3088\u3063\u3066\u51e6\u7406\u3092\u304b\u3048\u308b\u65b9\u6cd5\u3002 \u8d77\u52d5\u30b9\u30a4\u30c3\u30c1\u3068\u3044\u3046\u306e\u304c\u3042\u308b\u3089\u3057\u3044\u3002 \u53c2\u7167\uff1aMicrosoft Office \u88fd\u54c1\u306e\u30b3\u30de\u30f3\u30c9 \u30e9\u30a4\u30f3 \u30b9\u30a4\u30c3\u30c1 \u3068\u3044\u3046\u3053\u3068\u3067 &#038;qu [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,5],"tags":[],"class_list":["post-3112","post","type-post","status-publish","format-standard","hentry","category-sql","category-excelvba"],"_links":{"self":[{"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/3112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3112"}],"version-history":[{"count":9,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/3112\/revisions"}],"predecessor-version":[{"id":3121,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/3112\/revisions\/3121"}],"wp:attachment":[{"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3112"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}