{"id":292,"date":"2025-07-30T23:04:50","date_gmt":"2025-07-30T23:04:50","guid":{"rendered":"https:\/\/loufab.alwaysdata.net\/blogaccess\/?p=292"},"modified":"2025-07-31T22:27:56","modified_gmt":"2025-07-31T22:27:56","slug":"erreur-3010-avec-dao-createtabledef","status":"publish","type":"post","link":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/2025\/07\/30\/erreur-3010-avec-dao-createtabledef\/","title":{"rendered":"ACCESS : Erreur 3010 avec DAO.CreateTableDef()"},"content":{"rendered":"\n<p>Ce probl\u00e8me est constat\u00e9 le 16\/01\/2023<a href=\"https:\/\/web.archive.org\/web\/20240521202905\/http:\/\/blogaccess.free.fr\/?p=418#respond\"><\/a><\/p>\n\n\n\n<p>Le&nbsp;<strong>CreateTabledef()<\/strong>&nbsp;de&nbsp;<strong>DAO&nbsp;<\/strong>ne fonctionne plus comme avant !<br>Avec un :<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"visualbasic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Set td = db.CreateTableDef(tblname, dbAttachSavePWD, tblname, strConnexionOdbc)<\/pre>\n\n\n\n<p><br>On obtient une <strong>erreur 3010<\/strong>, la table existe d\u00e9j\u00e0, mais non elle n\u2019existe pas, ni dans la liste des objets, ni dans <strong>TableDefs <\/strong>et encore moins dans <strong>MsysObjects<\/strong>.<\/p>\n\n\n\n<p>Quand on observe <strong>td <\/strong>on peut voir que <strong>Name <\/strong>et \u00e9gal \u00e0 <strong>SourceTableName <\/strong>\u2026<br>Le contournement est possible :<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"visualbasic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Set td = db.CreateTableDef()\ntd.Name = strTable\ntd.SourceTableName = tblname\ntd.Connect = strConnexionOdbc\ntd.Attributes = dbAttachSavePWD<\/pre>\n\n\n\n<p><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ou encore :<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"visualbasic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">DoCmd.TransferDatabase acLink, \"ODBC Database\", strConnexionOdbc, acTable, tblname, strTable, False, False\n<\/pre>\n\n\n\n<p>Ce probl\u00e8me a \u00e9t\u00e9 constat\u00e9 avec une application qui fonctionne avec ce code depuis 2016, et sur une fonctionnalit\u00e9 qui est utilis\u00e9e quotidiennement.<\/p>\n\n\n\n<p>Le pilote ODBC n\u2019est pas en cause, des tests ont \u00e9t\u00e9 fait dans ce sens.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ce probl\u00e8me est constat\u00e9 le 16\/01\/2023 Le&nbsp;CreateTabledef()&nbsp;de&nbsp;DAO&nbsp;ne fonctionne plus comme avant !Avec un : On obtient une erreur 3010, la table existe d\u00e9j\u00e0, mais non elle n\u2019existe pas, ni dans la liste des objets, ni dans TableDefs et encore moins &hellip; <a href=\"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/2025\/07\/30\/erreur-3010-avec-dao-createtabledef\/\">Continuer la lecture <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,6],"tags":[],"class_list":["post-292","post","type-post","status-publish","format-standard","hentry","category-access","category-code-vba"],"_links":{"self":[{"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/posts\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/comments?post=292"}],"version-history":[{"count":2,"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/posts\/292\/revisions"}],"predecessor-version":[{"id":309,"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/posts\/292\/revisions\/309"}],"wp:attachment":[{"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/media?parent=292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/categories?post=292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/loufab.alwaysdata.net\/blogaccess\/index.php\/wp-json\/wp\/v2\/tags?post=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}