{"id":744,"date":"2017-05-31T13:55:54","date_gmt":"2017-05-31T04:55:54","guid":{"rendered":"https:\/\/knowhow.hirohiro716.com\/?p=744"},"modified":"2024-05-06T21:48:57","modified_gmt":"2024-05-06T12:48:57","slug":"adodb%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e3%81%ab%e6%8e%a5%e7%b6%9a%e3%81%99%e3%82%8bwindows%e9%99%90%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/weblog.hirohiro716.com\/?p=744","title":{"rendered":"LibreOffice\u306eVB\u3067ADODB\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3059\u308b(Windows\u9650\u5b9a)"},"content":{"rendered":"<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nDim connection As Object\r\nDim recordset As Object\r\nDim command As Object\r\nconnection = CreateObject(&quot;ADODB.Connection&quot;)\r\nrecordset = CreateObject(&quot;ADODB.Recordset&quot;)\r\ncommand = CreateObject(&quot;ADODB.Command&quot;)\r\n\r\n'SQLServer\u306b\u63a5\u7d9a\u3057\u3066\u307f\u308b\r\nconnection.Open &quot;Provider=SQLOLEDB;Data Source=DB_SERVER\\SQLEXPRESS;Initial Catalog=DB_NAME;User ID=sa;Password=123456;&quot;\r\n\r\ncommand.ActiveConnection = connection\r\ncommand.CommandTimeout = 0\r\ncommand.CommandText = &quot;SELECT * FROM TABLE_NAME;&quot;\r\nrecordset = command.Execute\r\n\r\nIf recordset.RecordCount &gt; 0 Then\r\n    If recordset.Eof = false Then\r\n       recordset.MoveFirst\r\n     MsgBox(recordset.Fields.Item(&quot;field1&quot;).Value)\r\n       'MsgBox(recordset.Fields.Item(&quot;field1&quot;).Name) \u2190\u3053\u308c\u306f\u4f7f\u3048\u306a\u3044\r\n End If\r\nEnd if\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Dim connection As Object Dim recordset As Object Dim command As Object connection = CreateObject(&quot;ADODB.C [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-744","post","type-post","status-publish","format-standard","hentry","category-libreoffice-calc"],"views":1697,"_links":{"self":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=744"}],"version-history":[{"count":4,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/744\/revisions"}],"predecessor-version":[{"id":2545,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/744\/revisions\/2545"}],"wp:attachment":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}