{"id":10762,"date":"2020-05-06T16:59:52","date_gmt":"2020-05-06T19:59:52","guid":{"rendered":"http:\/\/kb.elipse.com.br\/?p=10762"},"modified":"2020-05-06T16:59:52","modified_gmt":"2020-05-06T19:59:52","slug":"how-to-create-a-new-access-database-file-at-run-time","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/","title":{"rendered":"Creating a new Access database file at runtime."},"content":{"rendered":"<h3><strong>Question:<\/strong><\/h3>\n<p>Ho can I create a new Access database file for <a href=\"https:\/\/www.elipse.com.br\/en\/produto\/elipse-e3\/\" target=\"_blank\" rel=\"noopener noreferrer\">Elipse E3<\/a> at runtime?<\/p>\n<h3><\/h3>\n<h3><strong>Solution:<\/strong><\/h3>\n<div>\n<div class=\"page\" title=\"Page 106\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>The Database is an <a href=\"https:\/\/kb.elipse.com.br\/en\/category\/english\/elipse-scada-3\/databases-4\/\" target=\"_blank\" rel=\"noopener noreferrer\">Elipse E3<\/a> object used for storing the project&#8217;s information regarding Historics, Formulas, and Alarms. It can support the following formats: MDB (Microsoft Access), Oracle, and Microsoft SQL Server.<\/p>\n<p>Microsoft Access is a database management system provided by Microsoft. It comes with the Microsoft Office package, and can use any information that has been stored in any data receptacle in the ODBC. If you&#8217;re still not sure which database model is the right one for your project, you can check out our article <a href=\"https:\/\/kb.elipse.com.br\/en\/kb31974-databases-comparing-models\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>KB-31974: Databases: comparing models<\/strong><\/a> to help you make an informed decision.<\/p>\n<p>In order to create a new Access database file from scratch at runtime, you must first follow a few guidelines. First of all, you will need to deactivate all database objects, such as: databases, Historics, and Storage. Then, you must edit the database file; only after you&#8217;ve made these changes that can you you reactivate these objects.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>An important tip is: If you&#8217;re working in a query screen when the file is edited, you will need to remember to update the screen first.<\/div>\n<div><\/div>\n<div>The new file then can be created at runtime. To do so, you can follow the code we present below as an example. This code will deactivate the database&#8217;s objects, create a new file based on current data, and then reactivate the DB objects.<\/div>\n<div><\/div>\n<div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Set objHist = Application.GetObject(\"Hist1\")\u200b Set objDB = Application.GetObject(\"BancoDados1\")\r\n\r\n\u200b'Deactivate database objects\r\nobjDB.Deactivate()\u200b\r\nobjHist.Deactivate()\u200b\r\n\u200b\r\n'Create a new file based on current data \r\nCall objDB.SetDBParameters(\"C:\\CaminhoPastas\\Dados_\"&Day(Now)&\"_\"&Month(Now)&\"_\"&Year(Now)&\".mdb\", \"\", \"\", \"\")\u200b\r\nobjDB.Save\u200b\r\n\u200b\r\n'Reactivate all database objects \r\nobjDB.Activate()\u200b\r\nobjHist.Activate()<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<h3>Related articles:<\/h3>\n<hr \/>\n<ul>\n<li><a href=\"https:\/\/kb.elipse.com.br\/en\/structure-query-language-sql-chapter-3-data-discard-and-db-limits\/\" target=\"_blank\" rel=\"noopener noreferrer\">Structure Query Language (SQL): Chapter 3 \u2013 Data Discard and DB Limits.<\/a><\/li>\n<li><a href=\"https:\/\/kb.elipse.com.br\/en\/structure-query-language-sql-chapter-4-backup\/\" target=\"_blank\" rel=\"noopener noreferrer\">Structure Query Language (SQL): Chapter 4 \u2013 Backup.<\/a><\/li>\n<li><a href=\"https:\/\/kb.elipse.com.br\/en\/kb31974-databases-comparing-models\/\" target=\"_blank\" rel=\"noopener noreferrer\">KB-31974: Databases: comparing models<\/a>.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question: Ho can I create a new Access database file for Elipse E3 at runtime? Solution: The Database is an Elipse E3 object used for storing the project&#8217;s information regarding&hellip;<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[583,578,610],"tags":[1005,1004,1029],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to create a new Access database file at runtime<\/title>\n<meta name=\"description\" content=\"This article illustrates the necessary steps to take in order to create a new Access database file for Elipse E3 via scripts at runtime.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to create a new Access database file at runtime\" \/>\n<meta property=\"og:description\" content=\"This article illustrates the necessary steps to take in order to create a new Access database file for Elipse E3 via scripts at runtime.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-06T19:59:52+00:00\" \/>\n<meta name=\"author\" content=\"Marco Antonio Gomes Silva\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marco Antonio Gomes Silva\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/\"},\"author\":{\"name\":\"Marco Antonio Gomes Silva\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fa6d0b4f046e3b2c208aaf84a40154e9\"},\"headline\":\"Creating a new Access database file at runtime.\",\"datePublished\":\"2020-05-06T19:59:52+00:00\",\"dateModified\":\"2020-05-06T19:59:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/\"},\"wordCount\":565,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"keywords\":[\"Access\",\"Backup\",\"new file\"],\"articleSection\":[\"DataBases\",\"Elipse E3\",\"Scripts\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/\",\"name\":\"How to create a new Access database file at runtime\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2020-05-06T19:59:52+00:00\",\"dateModified\":\"2020-05-06T19:59:52+00:00\",\"description\":\"This article illustrates the necessary steps to take in order to create a new Access database file for Elipse E3 via scripts at runtime.\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating a new Access database file at runtime.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fa6d0b4f046e3b2c208aaf84a40154e9\",\"name\":\"Marco Antonio Gomes Silva\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7d19cf85bb457f81816ff5d785e3b9f4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7d19cf85bb457f81816ff5d785e3b9f4?s=96&d=mm&r=g\",\"caption\":\"Marco Antonio Gomes Silva\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/marco\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to create a new Access database file at runtime","description":"This article illustrates the necessary steps to take in order to create a new Access database file for Elipse E3 via scripts at runtime.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/","og_locale":"en_US","og_type":"article","og_title":"How to create a new Access database file at runtime","og_description":"This article illustrates the necessary steps to take in order to create a new Access database file for Elipse E3 via scripts at runtime.","og_url":"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2020-05-06T19:59:52+00:00","author":"Marco Antonio Gomes Silva","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Marco Antonio Gomes Silva","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/"},"author":{"name":"Marco Antonio Gomes Silva","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fa6d0b4f046e3b2c208aaf84a40154e9"},"headline":"Creating a new Access database file at runtime.","datePublished":"2020-05-06T19:59:52+00:00","dateModified":"2020-05-06T19:59:52+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/"},"wordCount":565,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"keywords":["Access","Backup","new file"],"articleSection":["DataBases","Elipse E3","Scripts"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/","url":"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/","name":"How to create a new Access database file at runtime","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2020-05-06T19:59:52+00:00","dateModified":"2020-05-06T19:59:52+00:00","description":"This article illustrates the necessary steps to take in order to create a new Access database file for Elipse E3 via scripts at runtime.","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/how-to-create-a-new-access-database-file-at-run-time\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"Creating a new Access database file at runtime."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fa6d0b4f046e3b2c208aaf84a40154e9","name":"Marco Antonio Gomes Silva","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7d19cf85bb457f81816ff5d785e3b9f4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7d19cf85bb457f81816ff5d785e3b9f4?s=96&d=mm&r=g","caption":"Marco Antonio Gomes Silva"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/marco\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/10762"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=10762"}],"version-history":[{"count":6,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/10762\/revisions"}],"predecessor-version":[{"id":10771,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/10762\/revisions\/10771"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=10762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=10762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=10762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}