{"id":184,"date":"2012-09-16T18:17:10","date_gmt":"2012-09-16T18:17:10","guid":{"rendered":"http:\/\/regina-whipp.com\/blog\/?p=184"},"modified":"2016-01-01T14:12:17","modified_gmt":"2016-01-01T19:12:17","slug":"update-database-front-ends","status":"publish","type":"post","link":"https:\/\/regina-whipp.com\/blog\/?p=184","title":{"rendered":"Update database front ends&#8230;"},"content":{"rendered":"<p>Everyone who has split a database needs a way to update the Frontends. There are a few choices out there&#8230;<\/p>\n<p><a href=\"http:\/\/www.autofeupdater.com\/\" target=\"_blank\">Tony\u2019s Auto FE Updater<\/a><br \/>\n<a href=\"http:\/\/btabdevelopment.com\/free-access-tools\/\" target=\"_blank\">BTAB Development Front-End Auto-Update Enabling Tool<\/a><br \/>\n<a href=\"http:\/\/www.databasejournal.com\/features\/msaccess\/article.php\/3286111\/Automatically-Deploy-a-New-Access-Client.htm\" target=\"_blank\">Automatically Deploy a New Access Client<\/a><\/p>\n<p>&#8230;and here\u2019s another one:<br \/>\nIn Backend (and this can be an SQL Server) create a table&#8230;<br \/>\ntblVersionControlMaster<br \/>\nvcmVersionControlID (PK, AutoNumber)<br \/>\nvcmVersion (Number, Double)<\/p>\n<p>In the Frontend where the forms, queries, etc. reside create table&#8230;<br \/>\ntblVersionControlLocal<br \/>\nvclVersionControlID (PK, AutoNumber)<br \/>\nvclVersion (Number, Double)<\/p>\n<p>Then create a link to the table in the Backend. It should look like this&#8230;<\/p>\n<div id=\"attachment_185\" style=\"width: 200px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2012\/09\/VersionControl2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-185\" class=\" wp-image-185\" title=\"VCNetwork\" src=\"http:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2012\/09\/VersionControl2.png\" alt=\"\" width=\"190\" height=\"51\" srcset=\"https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2012\/09\/VersionControl2.png 190w, https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2012\/09\/VersionControl2-150x40.png 150w\" sizes=\"auto, (max-width: 190px) 100vw, 190px\" \/><\/a><p id=\"caption-attachment-185\" class=\"wp-caption-text\">If on a Networked Drive<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_186\" style=\"width: 205px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2012\/09\/VersionControl.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-186\" class=\"size-full wp-image-186\" title=\"VCSQLServer\" src=\"http:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2012\/09\/VersionControl.png\" alt=\"\" width=\"195\" height=\"52\" srcset=\"https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2012\/09\/VersionControl.png 195w, https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2012\/09\/VersionControl-150x40.png 150w\" sizes=\"auto, (max-width: 195px) 100vw, 195px\" \/><\/a><p id=\"caption-attachment-186\" class=\"wp-caption-text\">If on an SQL Server<\/p><\/div>\n<p>Each table must have a matching PK, so, if tblVersionControlMaster has a PK of 1 then so must tblVersionControlLocal. That is needed for the UPDATE query to work. Once the tables are created, place a 1 on vcmVersion and vclVersion. That will become your starting number. If you want to start at another number that is fine, just make sure they are the same in both tables. You then need a folder on the Network, that everyone has the necessary permissions to, that will hold the updated Frontend.<\/p>\n<p>Now, we want to create a message to let the Users know what is going on. Open your database and go to Design Mode of your Main Menu (or Switchboard) and create a Label naming it lblVersionControl. Leave the Caption blank, if the Caption won\u2019t let you leave it blank, add a period, save and then go back and remove the period. I made my font color Red (#BA1419) but you can make yours whatever color you want. Next&#8230;<\/p>\n<p>&#8230;go to the VBA Editor behind the Main Menu (or Switchboard). At the top of the Form Module place&#8230;<\/p>\n<p>Private Sub Form_Current()<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n'Optional\r\n'This is to put the Version in the Caption of the Main Menu or Switchboard\r\n'For more tips http:\/\/www.access-diva.com\/tips.html\r\nMe.Caption = &quot;Main Menu version &quot; &amp; DLookup(&quot;vclVersion&quot;, &quot;tblVersionControlLocal&quot;) &amp; &quot;.x&quot;\r\n<\/pre>\n<p>End Sub<\/p>\n<p>Private Sub Form_Open(Cancel As Integer)<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n'Because the Frontends will be sent via eMail and\/or ftp\r\n'you will want the one you send you UPDATE the tblVersionControlMaster\r\n'For more tips http:\/\/www.access-diva.com\/tips.html\r\n\r\nDim strSQL As String\r\n\r\nstrLocalVersion = DLookup(&quot;vclVersion&quot;, &quot;tblVersionControlLocal&quot;)\r\nstrNetworkVersion = DLookup(&quot;vcmVersion&quot;, &quot;tblVersionControlMaster&quot;)\r\n\r\nIf strLocalVersion= strNetworkVersion Then\r\n     strSQL = &quot;UPDATE tblVersionControlLocal INNER JOIN tblVersionControlMaster &quot; &amp; _\r\n               &quot;ON tblVersionControlLocal.vclVersionControlID = tblVersionControlMaster.vcmVersionControlID &quot; &amp; _\r\n                &quot;SET tblVersionControlMaster.vcmVersion = &#x5B;tblVersionControlLocal]!&#x5B;vclVersion]&quot;\r\n              CurrentDb.Execute strSQL, dbFailOnError\r\nEnd If\r\n<\/pre>\n<p>End Sub<\/p>\n<p>Private Sub Form_Load()<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n'This part that checks if there is a newer Frontend on the Network\r\n'If there is one, the message will display informing the User\r\n'For more tips http:\/\/www.access-diva.com\/tips.html\r\n\r\nstrLocalVersion = DLookup(&quot;vclVersion&quot;, &quot;tblVersionControlLocal&quot;)\r\nstrNetworkVersion = DLookup(&quot;vcmVersion&quot;, &quot;tblVersionControlMaster&quot;)End Sub\r\n\r\nIf strLocalVersion = strNetworkVersion Then\r\n     lblVersionControl.Caption = &quot;Your version is out of date... EXIT, count to 10 and reopen!&quot;\r\nElse\r\n     lblVersionControl.Caption = &quot;&quot;\r\nEnd If\r\n<\/pre>\n<p>End Sub<\/p>\n<p>Private Sub Form_Unload(Cancel As Integer)<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n'This part calls the .CMD file that will actually do the copying\r\n'For more tips http:\/\/www.access-diva.com\/tips.html\r\n\r\nstrLocalVersion = DLookup(&quot;vclVersion&quot;, &quot;tblVersionControlLocal&quot;)\r\nstrNetworkVersion = DLookup(&quot;vcmVersion&quot;, &quot;tblVersionControlMaster&quot;)\r\n\r\nIf strLocalVersion = strNetworkVersion Then\r\n     Shell &quot;c m d \/c &quot;&quot;C:\\Folder\\update.c m d&quot;&quot;,vbHide&quot;\r\n     '***Extra spaces in C M D, remove after copy\/paste***\r\nEnd If\r\n<\/pre>\n<p>End Sub<\/p>\n<p>Now to create the file that actually does the work, open Notepad and copy\/ paste&#8230;<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nEcho Off\r\nping 1.1.1.1 -n 1 -w 2000\r\nCOPY \/Y &quot;\\\\ServerName\\Folder\\YourNEWFrontEnd.accdb&quot; &quot;C:\\Folder\\YourOLDFrontEnd.accdb&quot;\r\nREM START &quot;Msaccess.exe&quot; &quot;C:\\Folder\\YourNowNEWFrontEnd.accdb&quot;\r\n<\/pre>\n<p>Make sure you change the names to match your Server\\Path\\FrontEnd.accdb. Once you are done, save, naming it <strong>Update.cmd <\/strong>and place in the same folder as the Frontend, for everyone except your primary User.<\/p>\n<p>Now, you will need a primary User on the other end to send the updated file to, I generally pick a Manager or Supervisor. Send the file to them and tell them to open and close, making sure they detach from eMail and place in their Local folder first. This is done so that the UPDATE query in the On_Open event tells tblVersionControlMaster that there is a new version. <strong>Immediately<\/strong>, after closing, the file must be copied out to the folder on the Server&#8230; everyone else\u2019s Frontend will automatically update.<\/p>\n<p>Enjoy!<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_184\" class=\"pvc_stats all  \" data-element-id=\"184\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/regina-whipp.com\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Everyone who has split a database needs a way to update the Frontends. There are a few choices out there&#8230;<\/p>\n<p>Tony\u2019s Auto FE Updater BTAB Development Front-End Auto-Update Enabling Tool Automatically Deploy a New Access Client<\/p>\n<p>&#8230;and here\u2019s another one: In Backend (and this can be an SQL Server) create a table&#8230; tblVersionControlMaster vcmVersionControlID (PK, [&#8230;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_184\" class=\"pvc_stats all  \" data-element-id=\"184\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/regina-whipp.com\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,63],"tags":[64,18,19,21],"class_list":["post-184","post","type-post","status-publish","format-standard","hentry","category-access-tips","category-database-design","tag-access-tips","tag-database-design","tag-update-frontend","tag-vba","odd"],"_links":{"self":[{"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=184"}],"version-history":[{"count":36,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/184\/revisions"}],"predecessor-version":[{"id":1122,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/184\/revisions\/1122"}],"wp:attachment":[{"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}