<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>2016-07 on Funky Si's Test</title><link>https://blog-test.funkysi1701.com/2016/07/</link><description>Recent content in 2016-07 on Funky Si's Test</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><managingEditor>funkysi1701@gmail.com (Simon Foster)</managingEditor><webMaster>funkysi1701@gmail.com (Simon Foster)</webMaster><lastBuildDate>Thu, 21 Jul 2016 20:00:45 +0000</lastBuildDate><atom:link href="https://blog-test.funkysi1701.com/2016/07/index.xml" rel="self" type="application/rss+xml"/><item><title>Amazon Web Services</title><link>https://blog-test.funkysi1701.com/posts/2016/amazon-web-services/</link><author>funkysi1701@gmail.com (funkysi1701)</author><pubDate>Thu, 21 Jul 2016 20:00:45 +0000</pubDate><guid>https://blog-test.funkysi1701.com/posts/2016/amazon-web-services/</guid><category term="AWS">AWS</category><category term="Azure">Azure</category><category term="Amazon">Amazon</category><category term="Cloud">Cloud</category><media:content medium="image" type="image/png" url="https://blog-test.funkysi1701.com/images/2016/07/aws-300x169.png"/><description>&lt;p&gt;I am a big fan of Azure but I know zero about its biggest rival – Amazon Web Services or AWS.&lt;/p&gt;
&lt;p&gt;So lets sign up for a free trial and see what it can do.
&lt;img class="img-fluid" alt="Amazon Web Services" src="https://blog-test.funkysi1701.com/images/2016/07/aws-300x169.png" loading="lazy"
width="300" height="169"
/&gt;
&lt;/p&gt;
&lt;p&gt;The AWS free trial is available from &lt;a href="https://aws.amazon.com/free/" target="_blank" rel="noopener noreferrer"&gt;https://aws.amazon.com/free/&lt;/a&gt;
and lasts for 12 months. From memory I think the Azure free trial lasted only one month.&lt;/p&gt;
&lt;p&gt;To start you need to login with your amazon account and create an AWS account. This requires your name and address and your payment info (you will only get billed if use services not covered by your free trial).&lt;/p&gt;
&lt;p&gt;Interestingly AWS requires you to verify your identity via an automated phone call. (I don’t recall doing anything like this for Azure but please correct me if I am wrong.)&lt;/p&gt;
&lt;p&gt;Once you are logged in you get a series of links displaying all the different services that are available. First impression is this is a simpler view to Azure’s portal with a similar amount of services. At the top right is an option to select which region you want to use, in Azure I use North Europe and West Europe, AWS has Ireland and Frankfurt.&lt;/p&gt;
&lt;h2 id="create-a-web-app"&gt;Create a Web App&lt;a class="anchor ms-1" href="#create-a-web-app" aria-label="Permalink: Create a Web App"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;First thing to try is setting up a website. I selected create a web app and I get a page asking me for its basic details (very similar to Azure, however AWS asked what language your code is written in, Azure handles all of these) AWS websites appear to support a host of different options similar to Azure.&lt;/p&gt;
&lt;p&gt;The actual creation of your website takes a few moments (like on Azure). However the default URL for websites is similar to &lt;code&gt;https://test.vjbbimyv7w.eu-central-1.elasticbeanstalk.com/&lt;/code&gt; which is not quite as nice as the Azure equivalent &lt;code&gt;https://test.azurewebsites.net&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Azure has a host of command lines available via powershell. AWS has a similar command line interface called AWS CLI, including the option to deploy from git to your website.&lt;/p&gt;
&lt;p&gt;AWS Toolkit for Visual Studio is an extension that allows for the publishing of websites to AWS. (Just like you can publish to Azure)&lt;/p&gt;
&lt;p&gt;As I learn more about AWS I will continue to blog about it. &lt;a href="https://www.funkysi1701.com/posts/2016/amazon-web-services-pt-2/" target="_blank" rel="noopener noreferrer"&gt;Amazon Web Services Pt 2&lt;/a&gt;
&lt;/p&gt;</description></item><item><title>Clever things with MS Access</title><link>https://blog-test.funkysi1701.com/posts/2016/clever-things-ms-access/</link><author>funkysi1701@gmail.com (funkysi1701)</author><pubDate>Thu, 07 Jul 2016 20:00:45 +0000</pubDate><guid>https://blog-test.funkysi1701.com/posts/2016/clever-things-ms-access/</guid><category term="Database">Database</category><category term="Access">Access</category><category term="DevOps">DevOps</category><category term="SourceControl">SourceControl</category><description>&lt;p&gt;I hate MS Access and especially developing with it as you can’t do any thing clever with it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Wrong, Wrong, Wrong!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are a few clever things I have been able to script to make developing with it passable. I still would rather use Visual Studio but this improves the experience a fair bit.&lt;/p&gt;
&lt;h2 id="source-control"&gt;Source Control&lt;a class="anchor ms-1" href="#source-control" aria-label="Permalink: Source Control"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Access files are binary (I use the ADP/ADE file format but I assume other Access file formats have the same problem) and so you can’t diff them to see what has changed. This is bad.&lt;/p&gt;
&lt;p&gt;However there is a solution to this. A tool called Access SVN and can be downloaded from &lt;a href="https://accesssvn.codeplex.com/" target="_blank" rel="noopener noreferrer"&gt;https://accesssvn.codeplex.com/&lt;/a&gt;
, this gives you a way to extract to text files all the forms and reports that are in Access. Before every commit I would manually run this tool on my ADP file and extract to text files, then I would commit these text files to source control and could easily see what had changed in each commit.&lt;/p&gt;
&lt;p&gt;Despite the name Access SVN, the tool is not tied to subversion, you can use any source control system, I use git.&lt;/p&gt;
&lt;p&gt;Also included in this tool is a way to do this with the command line, so you can make this a build step on your build server. I have not used this extensively yet, but the syntax is fairly simple&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;asvn.exe e &lt;span style="color:#e6db74"&gt;&amp;#34;path to Access file&amp;#34;&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;path to txt files&amp;#34;&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;*.*&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The filter at the end &lt;em&gt;.&lt;/em&gt; allows you to specify what to extract so you could extract all forms/reports beginning with D with &amp;ldquo;&lt;em&gt;.D&lt;/em&gt;&amp;rdquo;. I had trouble using &lt;em&gt;.&lt;/em&gt; because the names of my forms/reports contain characters not allowed in a windows file name. I am sure there is a way round this but I haven’t had chance to look into it further yet.&lt;/p&gt;
&lt;h2 id="testing-ms-access"&gt;Testing MS Access&lt;a class="anchor ms-1" href="#testing-ms-access" aria-label="Permalink: Testing MS Access"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Surely testing is not possible with MS Access? I would have agreed with that statement the other day until I found a neat way of testing if a feature is enabled.&lt;/p&gt;
&lt;p&gt;Firstly a bit of background. I develop using MS Access 2003 because the design view is far easier to use, however because it is out of support all my users use MS Access 2010. MS Access 2010 has a feature called Tabbed Documents which allows all forms and reports to open in new tabs so you can easily switch between them. This feature can only be enabled in MS Access 2010 and has no effect if opening with MS Access 2003.&lt;/p&gt;
&lt;p&gt;If you use Access SVN on your Access file with tabbed documents turned on and off you will see UseMDIMode: 0 and UseMDIMode: 1 show up in the Database properties file. UseMDIMode: 0 means that tabbed documents is turned on.&lt;/p&gt;
&lt;p&gt;In powershell I can now write a test to see if UseMDIMode: 0 can be found in the database properties file&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Get-Content &lt;span style="color:#e6db74"&gt;&amp;#34;General\Database properties.dbp.txt&amp;#34;&lt;/span&gt; | Select-String &lt;span style="color:#e6db74"&gt;&amp;#34;UseMDIMode: 0&amp;#34;&lt;/span&gt; -quiet
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the test passes True will be returned, if it fails null will be returned.&lt;/p&gt;
&lt;p&gt;On my build server I scripted the extraction of Database properties.dbp.txt from the ADP file with asvn.exe before running this test. While not strictly needed as Database properties.dbp.txt should be in source control, it is possible that someone could forget to extract the text files from the ADP, with this step you are always testing what is enabled in the binary file.&lt;/p&gt;
&lt;h2 id="ms-access-connection-strings"&gt;MS Access Connection Strings&lt;a class="anchor ms-1" href="#ms-access-connection-strings" aria-label="Permalink: MS Access Connection Strings"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;While developing with MS Access I often swap the database connection to point to my local machine or a build server. I always try and remember to only ever commit with this set to the live database to avoid obvious problems.&lt;/p&gt;
&lt;p&gt;The other day I found on &lt;a href="https://stackoverflow.com/questions/16411430/change-access-server-connection-from-command-line" target="_blank" rel="noopener noreferrer"&gt;stackoverflow&lt;/a&gt;
a way to script this. I love this! I can include this step in my deployment process and it will overwrite what ever the connection string is in source control with what your production environment needs.&lt;/p&gt;
&lt;p&gt;All you need to run this step is, (note it is spaces between the parameters not commas)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cscript connect.vbs Project.adp &lt;span style="color:#e6db74"&gt;&amp;#34;ServerName&amp;#34;&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;DatabaseName&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The contents of connect.vbs can be found on the &lt;a href="https://stackoverflow.com/questions/16411430/change-access-server-connection-from-command-line" target="_blank" rel="noopener noreferrer"&gt;stackoverflow article&lt;/a&gt;
. It is also possible to pass username and password if your environment requires this.&lt;/p&gt;
&lt;h2 id="compiled-ade"&gt;Compiled ADE&lt;a class="anchor ms-1" href="#compiled-ade" aria-label="Permalink: Compiled ADE"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The last clever thing I do with MS Access is convert my ADP file into the compiled ADE version. To manually do this there is an option in the tools menu.&lt;/p&gt;
&lt;p&gt;To automate this I run&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;cscript createADE.vbs &lt;span style="color:#e6db74"&gt;&amp;#34;path to ADP&amp;#34;&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;path to ADE&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The contents of createADE came from this &lt;a href="https://social.msdn.microsoft.com/Forums/office/en-US/01fd48a9-258e-4405-86f1-adfb2f1057ee/create-an-access-2007-ade-from-a-adp-via-commandline?forum=accessdev" target="_blank" rel="noopener noreferrer"&gt;forum post&lt;/a&gt;
, the only change I made was to comment out some of the echo statements so it would run silently as part of my build process. It should be noted that cscript and wscript are almost identical and either will run these scripts however in a command line environment cscript is preferable, and wscript should be used in a windows environment.&lt;/p&gt;
&lt;p&gt;I am quite surprised at how much I have managed to do in terms of scripting the build and deployment process for MS Access. I still don’t like developing with Access but this has definitely improved things.&lt;/p&gt;</description></item></channel></rss>