<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-6873956949413362303</atom:id><lastBuildDate>Thu, 21 Apr 2011 18:01:25 +0000</lastBuildDate><title>Fuzzylogic</title><description>Fuzzylogic is a blog that explores Microsoft SQL Server, BI, C#, ASP.Net and sometimes MS Access. Oh yeh and I may even talk a little rugby now and again.</description><link>http://camerontownshend.blogspot.com/</link><managingEditor>noreply@blogger.com (Cameron Townshend)</managingEditor><generator>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/blogspot/eQYG" /><feedburner:info uri="blogspot/eqyg" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-479513058668207989</guid><pubDate>Mon, 28 Feb 2011 09:13:00 +0000</pubDate><atom:updated>2011-02-28T20:45:30.176+11:00</atom:updated><title>MGET with delete for FTP</title><description>A common problem for FTP users is how to download all the available files from an FTP server and delete them once they are downloaded. You can not simply perform mget *.* followed by mdelete *.* because there may be new files arrived onto the FTP server and you will delete them before they are downloaded.&lt;br /&gt;i.e. bad - potentially deletes files that we havent retrieved yet.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;mget *.*&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;mdelete *.*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are a number of approaches to solving this problem for example WINSCP grabs a file then deletes it one at a time. I wanted to use the inbuilt Microsoft FTP command in a batch to download the files to your local machine then delete the files that have successfully arrived one at a time from the FTP server but not delete files that I have not retrieved that may have arrived since we started work.&lt;br /&gt;This is how it is done.&lt;br /&gt;1) Create a batch file that gets the files that you want using an ftp script and then calls two batch files which create a delete script and then call the delete script, which we will do in steps 3 and 4 below&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color:#3366ff;"&gt;FTP -i -s:C:\TWC\GetFiles_FTP.txt ftp.XXX.XXX&lt;br /&gt;call C:\Data\createDelete.bat&lt;br /&gt;call C:\Data\Del_FTP.bat&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;2) The GetFiles_FTP.txt looks like this, a simple mget with your particular login details and path details&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;username&lt;br /&gt;password&lt;br /&gt;cd remotefolder&lt;br /&gt;bin&lt;br /&gt;mget *.* "C:\DATA\FILES\"&lt;br /&gt;bye&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;3) This is the magic step in createDelete.bat. The trick here is that we generate an ftp script file on the fly by echoing out the ftp login details to a file along with the output of the Forfiles command. This command loops though a path "-p" (note: no trailing back slash on the path) and for a file mask "-m" it performs a command "-c". I am echoing "del filename" into the script file so we get a list of del commands for each file that we have successfully retrieved onto our local machine. This means we wont delete files that we haven't retrieved.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;echo username&gt; C:\Data\deleteFiles.txt&lt;br /&gt;echo password&gt;&gt; C:\Data\deleteFiles.txt&lt;br /&gt;echo cd /remotefolder&gt;&gt; C:\Data\deleteFiles.txt&lt;br /&gt;echo bin&gt;&gt; C:\Data\deleteFiles.txt&lt;br /&gt;Forfiles -p "C:\Data\Files" -m *.* -c "cmd /c echo del @file&gt;&gt; C:\Data\deleteFiles.txt"&lt;br /&gt;echo bye&gt;&gt; C:\Data\deleteFiles.txt&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This creates a file similar to this&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;username&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;password&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;cd /remotefolder&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;bin&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;del "filename1"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;del "filename2" etc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;bye&lt;/span&gt;&lt;br /&gt;4) Final step is to create Del_FTP.bat which simply calls the FTP command with our newly created script file. This script file is recreated every time we run so we delete the downloaded files only.&lt;br /&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;cd C:\Data\&lt;br /&gt;FTP -i -s:C:\Data\deleteFiles.txt ftp.xxx.xxx&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;color:#3366ff;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6873956949413362303-479513058668207989?l=camerontownshend.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://camerontownshend.blogspot.com/2011/02/mget-with-delete-for-ftp.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-4722933790897926316</guid><pubDate>Thu, 14 Aug 2008 05:59:00 +0000</pubDate><atom:updated>2008-08-14T15:59:52.294+10:00</atom:updated><title>Problems Installing SQL Server 2008 RTM</title><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;I've spent a couple of days trying to install SQL Server 2008 RTM. I received the following error message.&lt;/p&gt;  &lt;p&gt;TITLE: Microsoft SQL Server 2008 Setup    &lt;br /&gt;------------------------------     &lt;br /&gt;The following error has occurred:     &lt;br /&gt;The process does not possess the 'SeSecurityPrivilege' privilege which is required for this operation.     &lt;br /&gt;Click 'Retry' to retry the failed action, or click 'Cancel' to cancel this action and continue setup. &lt;/p&gt;  &lt;p&gt;For help, click: &lt;a href="http://go.microsoft.com/fwlink?LinkID=20476&amp;amp;ProdName=Microsoft+SQL+Server&amp;amp;EvtSrc=setup.rll&amp;amp;EvtID=50000&amp;amp;ProdVer=10.0.1600.22&amp;amp;EvtType=0xE32A4906%25400xB49B3A64"&gt;http://go.microsoft.com/fwlink?LinkID=20476&amp;amp;ProdName=Microsoft+SQL+Server&amp;amp;EvtSrc=setup.rll&amp;amp;EvtID=50000&amp;amp;ProdVer=10.0.1600.22&amp;amp;EvtType=0xE32A4906%25400xB49B3A64&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;------------------------------    &lt;br /&gt;BUTTONS:     &lt;br /&gt;&amp;amp;Retry     &lt;br /&gt;Cancel     &lt;br /&gt;------------------------------&lt;/p&gt;  &lt;p&gt;When you go to the Microsoft link provided there is a very unhelpful error message.&lt;/p&gt;  &lt;p&gt;Details    &lt;br /&gt;&lt;b&gt;ID:&lt;/b&gt;     &lt;br /&gt;50000&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&lt;b&gt;Source:&lt;/b&gt;     &lt;br /&gt;setup.rll&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;We're sorry&lt;/p&gt;  &lt;p&gt;There is no additional information about this issue in the Error and Event Log Messages or Knowledge Base databases at this time. You can use the links in the Support area to determine whether any additional information might be available elsewhere.&lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;Thank you for searching on this message; your search helps us identify those areas for which we need to provide more information.&lt;/p&gt;  &lt;p&gt;----------------------&lt;/p&gt;  &lt;p&gt;Well anyway after a bit of searching it appears that the 'SeSecurityPrivilege' is linked to the local security policy - &amp;quot;Manage auditing and security log&amp;quot;.&amp;#160; You can access this by going to Control Panel\Administrative Tools\Local Security Policy. Then link to Local Policies\User Rights Assignment\Manage auditing and security log\&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/cameron.townshend/SKPJyjYmpGI/AAAAAAAAACI/R2zom5Wm7mI/s1600-h/image%5B2%5D.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="116" alt="image" src="http://lh3.ggpht.com/cameron.townshend/SKPJzXuW5hI/AAAAAAAAACM/xgRagf1K-V4/image_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;When you open that screen, you will see that your current account is not authorised to Manage auditing and security logs, this will cause the SQL Server 2008 install to fail. To rectify this, you will have to add your user or group to this list.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/cameron.townshend/SKPJz0Lx3pI/AAAAAAAAACQ/-hsxOwc3Xrs/s1600-h/image%5B5%5D.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="image" src="http://lh5.ggpht.com/cameron.townshend/SKPJ0XMEakI/AAAAAAAAACU/0KVxDVi0CkY/image_thumb%5B1%5D.png?imgmax=800" width="206" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Notice however that the &amp;quot;Add user or group&amp;quot; is disabled on my machine. This is because my PC is a member of a domain and this setting is set by the Domain administrator and not configurable by an end-user. This is despite my account actually being both a local and domain admin. You will have to get your domain administrator to add a group that you belong to into this role in the domain. After rebooting your machine to pick up the new privileges from the domain controller you will be able to install SQL Server 2008 successfully.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/cameron.townshend/SKPJ1Bp9iRI/AAAAAAAAACY/yOF6kCD5LHI/s1600-h/image%5B8%5D.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="184" alt="image" src="http://lh4.ggpht.com/cameron.townshend/SKPJ17_55vI/AAAAAAAAACc/ezHzzSfHNjQ/image_thumb%5B2%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;:) &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6873956949413362303-4722933790897926316?l=camerontownshend.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://camerontownshend.blogspot.com/2008/08/problems-installing-sql-server-2008-rtm.html</link><author>noreply@blogger.com (Cameron Townshend)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/cameron.townshend/SKPJzXuW5hI/AAAAAAAAACM/xgRagf1K-V4/s72-c/image_thumb.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-1512974518006029103</guid><pubDate>Fri, 18 Jul 2008 06:12:00 +0000</pubDate><atom:updated>2008-07-18T16:12:31.058+10:00</atom:updated><title>format string in MSAccess</title><description>&lt;p&gt;I recently trained some users in how to use the Format function in Microsoft Access. They wanted a definitive list of what the format strings could be. So it's probably not possible to document every single combination, however the new Microsoft Access 2007 online help does document a large number of really useful types. Go to Microsoft Office help Online &lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a title="http://office.microsoft.com/client/helppreview.aspx?AssetID=HV012026591033&amp;amp;ns=MSACCESS.DEV&amp;amp;lcid=3081&amp;amp;QueryID=gRnDnXje30&amp;amp;respos=1" href="http://office.microsoft.com/client/helppreview.aspx?AssetID=HV012026591033&amp;amp;ns=MSACCESS.DEV&amp;amp;lcid=3081&amp;amp;QueryID=gRnDnXje30&amp;amp;respos=1"&gt;http://office.microsoft.com/client/helppreview.aspx?AssetID=HV012026591033&amp;amp;ns=MSACCESS.DEV&amp;amp;lcid=3081&amp;amp;QueryID=gRnDnXje30&amp;amp;respos=1&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Here is an excerpt.&lt;/p&gt;  &lt;p&gt;Returns a &lt;b&gt;Variant&lt;/b&gt; (&lt;b&gt;String&lt;/b&gt;) containing an &lt;a href="http://office.microsoft.com/search/redir.aspx?AssetID=HV012009291033&amp;amp;CTT=5&amp;amp;Origin=HV012026591033"&gt;expression&lt;/a&gt; formatted according to instructions contained in a format expression.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Syntax&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Format&lt;/b&gt;(&lt;i&gt;expression&lt;/i&gt;[, &lt;i&gt;format&lt;/i&gt;[, &lt;i&gt;firstdayofweek&lt;/i&gt;[, &lt;i&gt;firstweekofyear&lt;/i&gt;]]])&lt;/p&gt;  &lt;p&gt;The &lt;b&gt;Format&lt;/b&gt; function syntax has these parts:&lt;/p&gt; q  &lt;br /&gt;Display the quarter of the year as a number (1 &amp;#8211; 4).  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6873956949413362303-1512974518006029103?l=camerontownshend.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://camerontownshend.blogspot.com/2008/07/format-string-in-msaccess.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6873956949413362303.post-6861827751362564348</guid><pubDate>Tue, 30 Oct 2007 07:09:00 +0000</pubDate><atom:updated>2007-10-30T18:10:25.641+11:00</atom:updated><title>Welcome to blogging</title><description>Here is a test blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6873956949413362303-6861827751362564348?l=camerontownshend.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://camerontownshend.blogspot.com/2007/10/welcome-to-blogging.html</link><author>noreply@blogger.com (Cameron Townshend)</author><thr:total>0</thr:total></item></channel></rss>

