{"id":558,"date":"2017-04-15T08:30:09","date_gmt":"2017-04-14T23:30:09","guid":{"rendered":"https:\/\/onaraboo.com\/?p=558"},"modified":"2017-04-14T11:21:09","modified_gmt":"2017-04-14T02:21:09","slug":"visual-basic-net-sqlite%e3%81%ae%e5%88%a9%e7%94%a8%e2%91%a2","status":"publish","type":"post","link":"https:\/\/onaraboo.com\/?p=558","title":{"rendered":"Visual Basic.NET SQLite\u306e\u5229\u7528\u2462"},"content":{"rendered":"<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/onaraboo.com\/?p=558\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/onaraboo.com\/?p=558\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"Visual Basic.NET SQLite\u306e\u5229\u7528\u2462\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img loading=\"lazy\" decoding=\"async\" src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_line\"><a href='http:\/\/line.me\/R\/msg\/text\/?Visual%20Basic.NET%20SQLite%E3%81%AE%E5%88%A9%E7%94%A8%E2%91%A2%0D%0Ahttps%3A%2F%2Fonaraboo.com%2F%3Fp%3D558' title='LINE\u3067\u9001\u308b' rel=nofollow class='wp_social_bookmarking_light_a' ><img src='https:\/\/onaraboo.com\/wordpress\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/line20x20.png' alt='LINE\u3067\u9001\u308b' title='LINE\u3067\u9001\u308b' width='20' height='20' class='wp_social_bookmarking_light_img' \/><\/a><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/onaraboo.com\/?p=558\" data-text=\"Visual Basic.NET SQLite\u306e\u5229\u7528\u2462\" data-lang=\"ja\">Tweet<\/a><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n<h2>\u30c7\u30fc\u30bf\u30c6\u30fc\u30d6\u30eb\u3092\u524a\u9664\u30fb\u4f5c\u6210\u3059\u308b\u30ed\u30b8\u30c3\u30af\u30b5\u30f3\u30d7\u30eb<\/h2>\n<p>\u904e\u53bb\u306e\u8a18\u4e8b\u306fSELECT\u30fbINSERT\u6587\u3092\u767a\u884c\u3057\u3066\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u30ed\u30b8\u30c3\u30af\u3067\u3057\u305f\u304c\u3001\u4eca\u5ea6\u306fCREATE\u6587\u3068DROP\u6587\u306e\u30b5\u30f3\u30d7\u30eb\u30ed\u30b8\u30c3\u30af\u3067\u3059\u3002<\/p>\n<h3>\u2605\u3000\u524d\u3005\u56de\u306e\u8a18\u4e8b\u3000\u2605<\/h3>\n<blockquote class=\"wp-embedded-content\" data-secret=\"c2WTmJUTAq\"><p><a href=\"https:\/\/onaraboo.com\/?p=286\">Visual Basic.NET SQLite\u306e\u5229\u7528<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Visual Basic.NET SQLite\u306e\u5229\u7528&#8221; &#8212; \u4e0a\u306b\u306f\u4e0a\u304c\u3042\u308b\u3055\" src=\"https:\/\/onaraboo.com\/?p=286&#038;embed=true#?secret=viLvKTdOtT#?secret=c2WTmJUTAq\" data-secret=\"c2WTmJUTAq\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h3>\u2605\u3000\u524d\u56de\u306e\u8a18\u4e8b\u3000\u2605<\/h3>\n<blockquote class=\"wp-embedded-content\" data-secret=\"tqn5bsuro8\"><p><a href=\"https:\/\/onaraboo.com\/?p=556\">Visual Basic.NET SQLite\u306e\u5229\u7528\u2461<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Visual Basic.NET SQLite\u306e\u5229\u7528\u2461&#8221; &#8212; \u4e0a\u306b\u306f\u4e0a\u304c\u3042\u308b\u3055\" src=\"https:\/\/onaraboo.com\/?p=556&#038;embed=true#?secret=035xQ3olm3#?secret=tqn5bsuro8\" data-secret=\"tqn5bsuro8\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>\u306a\u304a\u3001\u3053\u306e\u30d6\u30ed\u30b0\u5185\u306b\u8a18\u8f09\u3057\u3066\u3044\u308b\u30bd\u30fc\u30b9\u306e\u8ee2\u8f09\u30fb\u8ee2\u7528\u306b\u3064\u3044\u3066\u306f\u4f55\u3082\u7e1b\u308a\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u3054\u4f7f\u7528\u306e\u72b6\u6cc1\u306e\u5982\u4f55\u306b\u554f\u308f\u305a\u3001\u4f5c\u8005\u305f\u308b\u5f53\u65b9\u306f\u7d50\u679c\u306b\u3064\u3044\u3066\u305d\u306e\u8cac\u4efb\u3092\u4e00\u5207\u8ca0\u3044\u307e\u305b\u3093\u3002\u3054\u4f7f\u7528\u306f\u81ea\u5df1\u8cac\u4efb\u306e\u7bc4\u56f2\u3067\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n\r\n    Private Function SQLiteTable_DeleteCreate(ByVal strSQLiteDB As String) As Boolean\r\n\r\n        SQLiteTable_DeleteCreate = False\r\n\r\n        Try\r\n\r\n            '\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u306e\u5b58\u5728\u78ba\u8a8d\r\n            If System.IO.File.Exists(strSQLiteDB) = False Then\r\n                '\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f\u30a8\u30e9\u30fc\u3092\u51fa\u529b\u3057\u3066\u7d42\u4e86\u3059\u308b\r\n                MessageBox.Show(&quot;\u30a8\u30e9\u30fc&quot;, &quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error)\r\n                Return False\r\n                Exit Function\r\n\r\n            End If\r\n\r\n            Dim Connection As New SQLiteConnection\r\n            Dim Command As SQLiteCommand\r\n            Dim DataExecute As Integer\r\n            Dim strSQL As String = String.Empty\r\n\r\n            '\u63a5\u7d9a\u6587\u5b57\u5217\u3092\u8a2d\u5b9a\r\n            Connection.ConnectionString = &quot;Version=3;Data Source=&quot; &amp; strSQLiteDB &amp; &quot;;New=False;Compress=True;&quot;\r\n\r\n            '\u30aa\u30fc\u30d7\u30f3\r\n            Connection.Open()\r\n\r\n            '\u30b3\u30de\u30f3\u30c9\u4f5c\u6210\r\n            Command = Connection.CreateCommand\r\n\r\n            '\u65e2\u5b58\u30c6\u30fc\u30d6\u30eb\u306e\u524a\u9664\r\n            '&lt;&lt;&lt; SQL\u306e\u4f5c\u6210\u3010\u5f97\u610f\u5148\u30de\u30b9\u30bf\u3011 &gt;&gt;&gt;\r\n            strSQL = &quot;DROP TABLE \u5f97\u610f\u5148\u30de\u30b9\u30bf &quot;\r\n            'SQL\u3092\u30bb\u30c3\u30c8\r\n            Command.CommandText = strSQL\r\n            '\u30c7\u30fc\u30bf\u66f4\u65b0\r\n            Try\r\n                DataExecute = Command.ExecuteNonQuery()\r\n\r\n            Catch ex As Exception\r\n\r\n            End Try\r\n\r\n            '\u65b0\u898f\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\r\n            '&lt;&lt;&lt; SQL\u306e\u4f5c\u6210\u3010\u5f97\u610f\u5148\u30de\u30b9\u30bf\u3011 &gt;&gt;&gt;\r\n            strSQL = &quot;CREATE TABLE \u5f97\u610f\u5148\u30de\u30b9\u30bf (&quot;\r\n            strSQL += &quot;   \u5f97\u610f\u5148\u30b3\u30fc\u30c9  INTEGER     DEFAULT  0  NOT NULL &quot;\r\n            strSQL += &quot;  ,\u5f97\u610f\u5148\u540d\u79f0\uff11  VARCHAR(64) DEFAULT ' ' NOT NULL &quot;\r\n            strSQL += &quot;  ,\u5f97\u610f\u5148\u540d\u79f0\uff12  VARCHAR(64) DEFAULT ' ' NOT NULL &quot;\r\n            strSQL += &quot;  ,\u5927\u5206\u985e\u30b3\u30fc\u30c9  VARCHAR(4)  DEFAULT ' ' NOT NULL &quot;\r\n            strSQL += &quot;  ,\u4e2d\u5206\u985e\u30b3\u30fc\u30c9  VARCHAR(4)  DEFAULT ' ' NOT NULL &quot;\r\n            strSQL += &quot;  ,\u5c0f\u5206\u985e\u30b3\u30fc\u30c9  VARCHAR(4)  DEFAULT ' ' NOT NULL &quot;\r\n            strSQL += &quot;  ,CONSTRAINT ACCOUNT_PKY PRIMARY KEY (\u5f97\u610f\u5148\u30b3\u30fc\u30c9) &quot;\r\n            strSQL += &quot;  ) &quot;\r\n\r\n            'SQL\u3092\u30bb\u30c3\u30c8\r\n            Command.CommandText = strSQL\r\n            '\u30c7\u30fc\u30bf\u66f4\u65b0\r\n            DataExecute = Command.ExecuteNonQuery()\r\n\r\n\r\n            'SQL\u4f5c\u6210(\u6700\u9069\u5316\u306e\u5b9f\u884c)\r\n            Command.CommandText = &quot;VACUUM&quot;\r\n            '\u30c7\u30fc\u30bf\u66f4\u65b0\r\n            DataExecute = Command.ExecuteNonQuery()\r\n\r\n            '\u7834\u68c4\r\n            Command.Dispose()\r\n            Connection.Close()\r\n            Connection.Dispose()\r\n\r\n            Return True\r\n\r\n        Catch ex As Exception\r\n\r\n            '\u30a8\u30e9\u30fc\u51e6\u7406\r\n            Return False\r\n\r\n        End Try\r\n    End Function\r\n\r\n<\/pre>\n<p>\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u5f97\u610f\u5148\u30de\u30b9\u30bf\u3092DROP\u3057\u3066\u304b\u3089\u518d\u5ea6\u3001Create\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\nDELETE\u6587\u3092\u767a\u884c\u3057\u3066\u524a\u9664\u3059\u308b\u3088\u308a\u3001\u30c6\u30fc\u30d6\u30eb\u81ea\u4f53\u3092\u6d88\u3057\u3066\u4f5c\u3063\u305f\u65b9\u304c\u51e6\u7406\u304c\u65e9\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3053\u3053\u3067\u30dd\u30a4\u30f3\u30c8\u304c\u3053\u306e\u3088\u3046\u306a\u4f5c\u696d\uff08\u8868\u3092\u6d88\u3057\u3066\u4f5c\u3063\u305f\uff09\u3092\u7e70\u308a\u8fd4\u3059\u3068SQLite\u306e\u30d5\u30a1\u30a4\u30eb\u81ea\u4f53\u304c\u80a5\u5927\u5316\u3057\u3066\u3044\u304d\u307e\u3059\u306e\u3067\u3001\u6700\u9069\u5316\u3092\u884c\u3063\u3066\u6574\u7406\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u306e\u3088\u3046\u306b\u51e6\u7406\u3092\u5165\u308c\u308b\u3053\u3068\u3067\u5e38\u306b\u6700\u9069\u5316\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u3064\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3057\u3001\u6700\u9069\u5316\u81ea\u4f53\u306b\u51e6\u7406\u6642\u9593\u3092\u53d6\u3089\u308c\u308b\u3088\u3046\u306a\u5927\u304d\u306a\u30d5\u30a1\u30a4\u30eb\u306e\u5834\u5408\u306f\u3042\u307e\u308a\u304a\u52e7\u3081\u3067\u304d\u308b\u65b9\u6cd5\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u30b1\u30fc\u30b9\u30d0\u30a4\u30b1\u30fc\u30b9\u3067\u624b\u6cd5\u3092\u6a21\u7d22\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u307e\u3060\u307e\u3060\u5fdc\u7528\u3084\u4f7f\u3044\u9053\u306b\u3064\u3044\u3066\u8abf\u3079\u3066\u30e1\u30e2\u3057\u307e\u3059\u3002\u6b21\u56de\u3078\u7d9a\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30c7\u30fc\u30bf\u30c6\u30fc\u30d6\u30eb\u3092\u524a\u9664\u30fb\u4f5c\u6210\u3059\u308b\u30ed\u30b8\u30c3\u30af\u30b5\u30f3\u30d7\u30eb \u904e\u53bb\u306e\u8a18\u4e8b\u306fSELECT\u30fbINSERT\u6587\u3092\u767a\u884c\u3057\u3066\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u30ed\u30b8\u30c3\u30af\u3067\u3057\u305f\u304c\u3001\u4eca\u5ea6\u306fCREATE\u6587\u3068DROP\u6587\u306e\u30b5\u30f3\u30d7\u30eb\u30ed\u30b8\u30c3\u30af\u3067\u3059\u3002 \u2605\u3000\u524d\u3005\u56de&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/onaraboo.com\/?p=558\">Read more<span class=\"screen-reader-text\">Visual Basic.NET SQLite\u306e\u5229\u7528\u2462<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,5,2],"tags":[],"class_list":["post-558","post","type-post","status-publish","format-standard","hentry","category-visual-basic-net","category-5","category-2","entry"],"_links":{"self":[{"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/posts\/558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/onaraboo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=558"}],"version-history":[{"count":0,"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/posts\/558\/revisions"}],"wp:attachment":[{"href":"https:\/\/onaraboo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/onaraboo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/onaraboo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}