{"id":6380,"date":"2017-10-04T08:59:08","date_gmt":"2017-10-03T23:59:08","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=6380"},"modified":"2017-10-23T12:49:47","modified_gmt":"2017-10-23T03:49:47","slug":"%e3%83%86%e3%83%bc%e3%83%96%e3%83%ab%e3%81%ae%e4%bd%9c%e6%88%90%e3%83%bb%e5%89%8a%e9%99%a4%ef%bc%8f%e3%83%95%e3%82%a3%e3%83%bc%e3%83%ab%e3%83%89%e3%81%ae%e4%bd%9c%e6%88%90%e3%83%bb%e5%89%8a%e9%99%a4","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/%e3%83%86%e3%83%bc%e3%83%96%e3%83%ab%e3%81%ae%e4%bd%9c%e6%88%90%e3%83%bb%e5%89%8a%e9%99%a4%ef%bc%8f%e3%83%95%e3%82%a3%e3%83%bc%e3%83%ab%e3%83%89%e3%81%ae%e4%bd%9c%e6%88%90%e3%83%bb%e5%89%8a%e9%99%a4\/","title":{"rendered":"\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\u30fb\u524a\u9664\uff0f\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u4f5c\u6210\u30fb\u524a\u9664\uff08ADOX\uff09"},"content":{"rendered":"<h2>ADOX \u3092\u4f7f\u7528\u3057\u3066\u30c6\u30fc\u30d6\u30eb\u30fb\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u3092\u4f5c\u6210\u30fb\u524a\u9664<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"adox_table\">Table \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/h3>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1cCreateObject \u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\uff1e<\/strong><\/span><br \/>\n    <b>Dim<\/b> <em>tbl<\/em> <b>As Object<\/b><br \/>\n    <b>Set<\/b> <em>tbl<\/em> = <b>CreateObject(&#8220;ADOX.Table&#8221;)<\/b><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53c2\u7167\u8a2d\u5b9a\u3092\u884c\u3046\u5834\u5408\uff1e<\/strong><\/span><br \/>\n    <b>Dim<\/b> <em>tbl<\/em> <b>As ADOX.Table<\/b><br \/>\n    <b>Set<\/b> <em>tbl<\/em> = <b>New ADOX.Table<\/b><\/p><\/div>\n<br \/>\n<h4>\u53c2\u7167\u8a2d\u5b9a\u3092\u884c\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u30d5\u30a1\u30a4\u30eb\u306b\u3064\u3044\u3066<\/h4>\n<div class=\"m30-l\">\n    <br \/><\/p>\n<p class=\"caution4\">Microsoft ADO Ext.6.0 for DDL and Security \u3092\u9078\u629e\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001Office \u7b49\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u308a\u3001ADOX \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3082\u7570\u306a\u308a\u307e\u3059\u3002\u53c2\u7167\u8a2d\u5b9a\u306e\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08FileSystemObject\uff09\u306e\u4f7f\u3044\u65b9 \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p class=\"caution4\"><strong>CreatObject \u95a2\u6570<\/strong> \u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u53c2\u7167\u8a2d\u5b9a\u306e\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001VBE \u3067\u3001\u81ea\u52d5\u30e1\u30f3\u30d0\u8868\u793a\u7b49\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u652f\u63f4\u6a5f\u80fd\u304c\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002\u307e\u305f\u3001\u30de\u30af\u30ed\u306e\u5b9f\u884c\u901f\u5ea6\u3082\u9045\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<\/p><\/div>\n<br \/><br \/>\n<h3 id=\"adox_tablename\">Name \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>Name<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>Table \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution4\">\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u8868\u3059\u6587\u5b57\u5217\u578b\uff08String\uff09\u306e\u5024\u3092\u53d6\u5f97\u304a\u3088\u3073\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<\/p><\/div>\n<br \/><br \/>\n<h3 id=\"adox_tablecolumns\">Columns \u30b3\u30ec\u30af\u30b7\u30e7\u30f3<\/h3>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>Columns<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u3092\u4f5c\u6210\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>Columns<\/strong>.<strong>Append<\/strong> <em>Column<\/em> [, <em>Type<\/em>, <em>DefineSize<\/em> ]<\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u3092\u524a\u9664\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>Columns<\/strong>.<strong>Delete<\/strong> <em>Column<\/em><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>Table \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>Column&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u540d\u3092\u8868\u3059\u6587\u5b57\u5217\u578b\uff08String\uff09\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\uff08\u7701\u7565\u4e0d\u53ef\uff09<\/li>\n<li>Type&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u306e\u30c7\u30fc\u30bf\u578b\u3092\u4ee5\u4e0b\u306e\u5b9a\u6570\u307e\u305f\u306f\u5024\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002\uff08\u7701\u7565\u53ef\uff09<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"250\" bgcolor=\"#ffffccc\"><strong>\u5b9a\u6570<\/strong><\/td>\n<td align = \"center\" width=\"80\" bgcolor=\"#ffffccc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"320\" bgcolor=\"#ffffccc\"><strong>\u30c7\u30fc\u30bf\u578b<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"250\">adSmallInt<\/td>\n<td width=\"80\" align = \"center\">2<\/td>\n<td width=\"320\">\u6574\u6570\u578b<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">adInteger<\/td>\n<td width=\"80\" align = \"center\">3<\/td>\n<td width=\"320\">\u9577\u6574\u6570\u578b<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">adSingle<\/td>\n<td width=\"80\" align = \"center\">4<\/td>\n<td width=\"320\">\u5358\u7cbe\u5ea6\u6d6e\u52d5\u5c11\u6570\u70b9\u578b<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">adDouble<\/td>\n<td width=\"80\" align = \"center\">5<\/td>\n<td width=\"320\">\u500d\u7cbe\u5ea6\u6d6e\u52d5\u5c11\u6570\u70b9\u578b<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">adCurrency<\/td>\n<td width=\"80\" align = \"center\">6<\/td>\n<td width=\"320\">\u901a\u8ca8\u578b<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">adDate<\/td>\n<td width=\"80\" align = \"center\">7<\/td>\n<td width=\"320\">\u65e5\u4ed8\u6642\u523b\u578b<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">adBoolean<\/td>\n<td width=\"80\" align = \"center\">11<\/td>\n<td width=\"320\">\u30d6\u30fc\u30eb\u578b<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">adGUID<\/td>\n<td width=\"80\" align = \"center\">72<\/td>\n<td width=\"320\">\u30aa\u30fc\u30c8\u30ca\u30f3\u30d0\u30fc\u578b<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">adVarWChar<\/td>\n<td width=\"80\" align = \"center\">202<\/td>\n<td width=\"320\">\u30c6\u30ad\u30b9\u30c8\u578b<\/td>\n<\/tr>\n<tr>\n<td width=\"250\">adLongVarWChar<\/td>\n<td width=\"80\" align = \"center\">203<\/td>\n<td width=\"320\">\u30e1\u30e2\u578b<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<li>DefineSize&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u306e\u30b5\u30a4\u30ba\u3092\u8868\u3059\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\uff08\u7701\u7565\u53ef\uff09\u3000\u203b <em>Type<\/em> \u304c\u30c6\u30ad\u30b9\u30c8\u578b\u3084\u30e1\u30e2\u578b\u306e\u5834\u5408\u3001\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<br \/><br \/>\n<h3 id=\"adox_tables\">Tables \u30b3\u30ec\u30af\u30b7\u30e7\u30f3<\/h3>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>Tables<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u65b0\u898f\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>Tables<\/strong>.<strong>Append<\/strong> <em>Table<\/em><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u30c6\u30fc\u30d6\u30eb\u306e\u524a\u9664\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>Tables<\/strong>.<strong>Delete<\/strong> <em>Table<\/em><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>Catalog \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>Table&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u4f5c\u6210\u307e\u305f\u306f\u524a\u9664\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u8868\u3059\u6587\u5b57\u5217\u578b\uff08String\uff09\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<\/div>\n<br \/><br \/>\n<h2>ADOX \u3092\u4f7f\u7528\u3057\u3066\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u4f8b<\/h2>\n<div class=\"m30-l\">\n<br \/>\n<h3 id=\"vba_sample1\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9 \u305d\u306e\uff11<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"\u53c2\u7167\u8a2d\u5b9a\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_ADOX_CreateTable1()\r\n\r\n    '\u53c2\u7167\u8a2d\u5b9a:Microsoft ADO Ext.6.0 for DDL and Security\r\n    \r\n    Dim cat As ADOX.Catalog\r\n    Dim tbl As ADOX.Table\r\n    Dim ConStr As String\r\n    Dim DBFile As String\r\n    \r\n    On Error GoTo ErrHandler\r\n    \r\n    '\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30d1\u30b9\u3068\u540d\u524d\r\n    \r\n    'Access 2007\u4ee5\u964d\uff08accdb \u30d5\u30a1\u30a4\u30eb\uff09\r\n    DBFile = ActiveWorkbook.Path & \"\\mydb2.accdb\"\r\n    ConStr = \"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\" & DBFile\r\n    \r\n    'Access 2003\u4ee5\u524d\uff08mdb \u30d5\u30a1\u30a4\u30eb\uff09\r\n    'DBFile = ActiveWorkbook.Path & \"\\mydb2.mdb\"\r\n    'ConStr = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\" & DBFile\r\n    \r\n    '\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\r\n    Set cat = New ADOX.Catalog\r\n    cat.ActiveConnection = ConStr\r\n    \r\n    '\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\r\n    Set tbl = New ADOX.Table\r\n    tbl.Name = \"Table1\"\r\n    Set tbl.ParentCatalog = cat\r\n    \r\n    '\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u306e\u8a2d\u5b9a\r\n    tbl.Columns.Append \"\u767b\u9332ID\", adInteger\r\n    tbl.Columns.Append \"\u6c0f\u540d\", adVarWChar\r\n    tbl.Columns.Append \"\u751f\u5e74\u6708\u65e5\", adDate\r\n    tbl.Columns.Append \"\u5099\u8003\", adLongVarWChar\r\n    \r\n    '\u30c6\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u767b\u9332\r\n    cat.Tables.Append tbl\r\n    \r\nErrHandler:\r\n    If Err.Number <> 0 Then\r\n        MsgBox Err.Number & vbCrLf & Err.Description\r\n    End If\r\n    \r\n    Set cat = Nothing\r\n    Set tbl = Nothing\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?ssl=1\" rel=\"lightbox[6380]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?resize=580%2C238&#038;ssl=1\" alt=\"ADOX \u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\" width=\"580\" height=\"238\" class=\"alignnone size-large wp-image-6383\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?resize=580%2C238&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?resize=400%2C164&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?w=736&amp;ssl=1 736w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/>\n<h3 id=\"vba_sample2\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9 \u305d\u306e\uff12<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"CreateObject \u95a2\u6570\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_ADOX_CreateTable2()\r\n\r\n    Dim cat As Object\r\n    Dim tbl As Object\r\n    Dim ConStr As String\r\n    Dim DBFile As String\r\n    \r\n    On Error GoTo ErrHandler\r\n    \r\n    '\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30d1\u30b9\u3068\u540d\u524d\r\n    \r\n    'Access 2007\u4ee5\u964d\uff08accdb \u30d5\u30a1\u30a4\u30eb\uff09\r\n    DBFile = ActiveWorkbook.Path & \"\\mydb2.accdb\"\r\n    ConStr = \"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\" & DBFile\r\n    \r\n    'Access 2003\u4ee5\u524d\uff08mdb \u30d5\u30a1\u30a4\u30eb\uff09\r\n    'DBFile = ActiveWorkbook.Path & \"\\mydb2.mdb\"\r\n    'ConStr = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\" & DBFile\r\n    \r\n    '\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\r\n    Set cat = CreateObject(\"ADOX.Catalog\")\r\n    cat.ActiveConnection = ConStr\r\n    \r\n    '\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\r\n    Set tbl = CreateObject(\"ADOX.Table\")\r\n    tbl.Name = \"Table1\"\r\n    Set tbl.ParentCatalog = cat\r\n    \r\n    '\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u306e\u8a2d\u5b9a\r\n    tbl.Columns.Append \"\u767b\u9332ID\", adInteger\r\n    tbl.Columns.Append \"\u6c0f\u540d\", adVarWChar\r\n    tbl.Columns.Append \"\u751f\u5e74\u6708\u65e5\", adDate\r\n    tbl.Columns.Append \"\u5099\u8003\", adLongVarWChar\r\n    \r\n    '\u30c6\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u767b\u9332\r\n    cat.Tables.Append tbl\r\n    \r\nErrHandler:\r\n    If Err.Number <> 0 Then\r\n        MsgBox Err.Number & vbCrLf & Err.Description\r\n    End If\r\n    \r\n    Set cat = Nothing\r\n    Set tbl = Nothing\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?ssl=1\" rel=\"lightbox[6380]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?resize=580%2C238&#038;ssl=1\" alt=\"ADOX \u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\" width=\"580\" height=\"238\" class=\"alignnone size-large wp-image-6383\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?resize=580%2C238&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?resize=400%2C164&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?w=736&amp;ssl=1 736w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n<h2>ADOX \u3092\u4f7f\u7528\u3057\u3066\u30c6\u30fc\u30d6\u30eb\uff08Access\uff09\u3092\u524a\u9664\u3059\u308b\u4f8b<\/h2>\n<div class=\"m30-l\">\n<br \/>\n<h3 id=\"vba_sample3\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"\u30c6\u30fc\u30d6\u30eb\u524a\u9664\uff08ADOX\uff09\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_ADOX_DeleteTable()\r\n\r\n    '\u53c2\u7167\u8a2d\u5b9a:Microsoft ADO Ext.6.0 for DDL and Security\r\n                    \r\n    Dim cat As ADOX.Catalog\r\n    Dim ConStr As String\r\n    Dim DBFile As String\r\n    \r\n    On Error GoTo ErrHandler\r\n    \r\n    '\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30d1\u30b9\u3068\u540d\u524d\r\n    \r\n    'Access 2007\u4ee5\u964d\uff08accdb \u30d5\u30a1\u30a4\u30eb\uff09\r\n    DBFile = ActiveWorkbook.Path & \"\\mydb2.accdb\"\r\n    ConStr = \"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\" & DBFile\r\n    \r\n    'Access 2003\u4ee5\u524d\uff08mdb \u30d5\u30a1\u30a4\u30eb\uff09\r\n    'DBFile = ActiveWorkbook.Path & \"\\mydb2.mdb\"\r\n    'ConStr = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\" & DBFile\r\n    \r\n    '\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\r\n    Set cat = New ADOX.Catalog\r\n    cat.ActiveConnection = ConStr\r\n    \r\n    '\u30c6\u30fc\u30d6\u30eb\u300cTable1\u300d\u3092\u524a\u9664\r\n    cat.Tables.Delete \"Table1\"\r\n    \r\nErrHandler:\r\n    If Err.Number <> 0 Then\r\n        MsgBox Err.Number & vbCrLf & Err.Description\r\n    End If\r\n    \r\n    Set cat = Nothing\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable03.jpg?ssl=1\" rel=\"lightbox[6380]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable03.jpg?resize=580%2C316&#038;ssl=1\" alt=\"ADOX \u30c6\u30fc\u30d6\u30eb\u3092\u524a\u9664\u3059\u308b\" width=\"580\" height=\"316\" class=\"alignnone size-large wp-image-6388\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable03.jpg?resize=580%2C316&amp;ssl=1 580w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable03.jpg?resize=400%2C218&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable03.jpg?w=585&amp;ssl=1 585w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n<h2>ADOX \u3092\u4f7f\u7528\u3057\u3066\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u3092\u524a\u9664<\/h2>\n<div class=\"m30-l\">\n<br \/>\n<h3 id=\"vba_sample4\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u3092\u524a\u9664\uff08ADOX\uff09\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_ADOX_CreateFields()\r\n\r\n    '\u53c2\u7167\u8a2d\u5b9a:Microsoft ADO Ext.6.0 for DDL and Security\r\n                    \r\n    Dim cat As ADOX.Catalog\r\n    Dim tbl As ADOX.Table\r\n    Dim ConStr As String\r\n    Dim DBFile As String\r\n    Dim strTables As String\r\n    \r\n    On Error GoTo ErrHandler\r\n    \r\n    '\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30d1\u30b9\u3068\u540d\u524d\r\n    \r\n    'Access 2007\u4ee5\u964d\uff08accdb \u30d5\u30a1\u30a4\u30eb\uff09\r\n    DBFile = ActiveWorkbook.Path & \"\\mydb2.accdb\"\r\n    ConStr = \"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\" & DBFile\r\n    \r\n    'Access 2003\u4ee5\u524d\uff08mdb \u30d5\u30a1\u30a4\u30eb\uff09\r\n    'DBFile = ActiveWorkbook.Path & \"\\mydb2.mdb\"\r\n    'ConStr = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\" & DBFile\r\n    \r\n    '\u30c6\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\r\n    Set cat = New ADOX.Catalog\r\n    cat.ActiveConnection = ConStr\r\n    \r\n    '\u30c6\u30fc\u30d6\u30eb\u53c2\u7167\r\n    Set tbl = cat.Tables(\"Table1\")\r\n    \r\n    '\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u306e\u524a\u9664\r\n    tbl.Columns.Delete \"\u767b\u9332ID\"\r\n    tbl.Columns.Delete \"\u5099\u8003\"\r\n            \r\nErrHandler:\r\n    If Err.Number <> 0 Then\r\n        MsgBox Err.Number & vbCrLf & Err.Description\r\n    End If\r\n    \r\n    Set cat = Nothing\r\n    Set tbl = Nothing\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u524d<\/h3>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?ssl=1\" rel=\"lightbox[6380]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?resize=580%2C238&#038;ssl=1\" alt=\"ADOX \u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\" width=\"580\" height=\"238\" class=\"alignnone size-large wp-image-6383\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?resize=580%2C238&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?resize=400%2C164&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?w=736&amp;ssl=1 736w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/>\n<h3>\u5b9f\u884c\u5f8c<\/h3>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable04.jpg?ssl=1\" rel=\"lightbox[6380]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable04.jpg?resize=580%2C249&#038;ssl=1\" alt=\"ADOX \u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u524a\u9664\" width=\"580\" height=\"249\" class=\"alignnone size-large wp-image-6385\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable04.jpg?resize=580%2C249&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable04.jpg?resize=400%2C172&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable04.jpg?w=739&amp;ssl=1 739w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>ADOX \u3092\u4f7f\u7528\u3057\u3066\u30c6\u30fc\u30d6\u30eb\u30fb\u30d5\u30a3\u30fc\u30eb\u30c9\uff08\u5217\uff09\u3092\u4f5c\u6210\u30fb\u524a\u9664 Table \u30aa\u30d6\u30b8\u30a7 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":6383,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[948],"tags":[953,950,1017,1011,721,968,951,1014,1016,1015,1013,814,955,949,835],"jetpack_featured_media_url":"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2017\/09\/adox_createtable01.jpg?fit=736%2C302&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1EU","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/6380"}],"collection":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/comments?post=6380"}],"version-history":[{"count":8,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/6380\/revisions"}],"predecessor-version":[{"id":6480,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/6380\/revisions\/6480"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/6383"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=6380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=6380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=6380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}