Monday, 6 June 2011

BES Hell and the Case of the Missing Window

I was called on Friday... BES Express server down... numskull pulled the plug out of the wall... possibly during a SQL write... pages broken... help!

BESX - version 5.0.2 (Bundle 14)

Where do I start?

Logged into SQL Manager and ran "dbcc checkdb" on all the databases.... consistency errors in some of the tables in BESX... ran "dbcc checkdb (<dbname>, repair_allow_data_loss)" ran "dbcc rebuildindex <tablename>" on the tables... 12 consistency errors fixed...  I accept some data loss in this...

BESX Administration Service - "cannot find the requested page" or "Internet Explorer cannot display the webpage." - the same goes for Web Desktop Manager.  The joy of tying up all of your software's capabilities into a single jvm.dll based web UI... you can't be blamed if it doesn't load up....

So what is to blame?  I don't know.. I search high and low... In the end I uninstalled BESX.  To my regret.

One step back... I wanted to repair install BESX.  So I ran the installer - it stopped - error 2803.  I stopped all the services and tried again.  This time to install BESX "over the top".  I got through to the "Use Existing Configuration Database" .. cool... I can simply install this over the top...

Too soon! "The BlackBerry Configuration Database that you specified is associated with a previous installation of the BlackBerry Enterprise Server or BlackBerry Professional Software. You must create a new BlackBerry Configuration Database for BlackBerry Enterprise Server Express or specify a database that is associated with a previous installation of BlackBerry Enterprise Server Express."

I got fed up with it here - it IS a Config DB for BESX not BES - what are RIM talking about with this error message?... time was running out and I it had to be ready for Monday morning... so I uninstalled BESX.  I regret.

Oh joy... I bet this has something to do with AVG... (lol... I did check but I think AVG was acting normally... it had 58,124 "Virus Found FakeAlert" messages that took forever to not delete.. so when I came back much later a) the program had crashed and b) they had not been deleted ... i so love AVG - not)... 

I found somewhere online mention that I should check that the user BESADMIN has "Allow Log on Locally" as a right before I install BESX (on a side note - I checked through the Release Notes for BESX 5.0.3 (Bundle 12) and decided to download that - in case they'd fixed the 'configuration database is associated with BES and not BESX' error message (bug)... so .. Local Security Policy... er... what's going on here?
MMC could not create the snap-in
MMC could not create the snap-in The snap-in might not have been installed correctly.
Name: Group Policy object Editor
CLSID:{8FC0B734-A0E1-11D1-A7D3-0000F87571E3}
Darn it... something messed up with secpol.msc... Apparently we need gpedit.dll and gptext.dll... they are in System32 folder... and they are registered.. ("regsvr32 gptext.dll" worked but gpedit.dll threw a wobbly...) ... But that didn't solve it... I also need FrameDyn.dll from the wbem folder... it's there... and the program has to find that on the environment variable, PATH

Right... System Properties -> Advanced -> Environment Variables -> PATH= ... er... "...C:\System32;C:\System32\wbem;..."  WTF?!  Where has the "\Window" bit gone?  It goes to show that Windows Server can survive, just about, with this missing ... if you search around online for "c:\system32\wbem" it should not exist ... but it does exist - in one place someone uses it in a solution for the FrameDyn.dll ..  we are pointed to this kb http://support.microsoft.com/?kbid=826282  - be careful with implementing the solution... check that you don't just have a missing 'Window' next to the wbem path.

I wonder now... in retrospect, whether this missing Window was actually the cause of BESX not being able to load the Admin Service or Web Manager.   It can't check the security principals etc... It can't find WMI... 

BESX installed... we couldn't restore the old database over the top.. or copy data from the old db to the new... so we have had to wipe all the users' Blackberrys and reload them... thanks RIM...

The night was so long I can't remember if that was all there was... Space was an issue... an old server, so of course the Windows\installer folder was taking up several gigabytes which can't be removed safely... and the size of the system drive was only 12GB... from the days of small disks...  time for a complete re-install perhaps... 

I doubt anyone who reads this will have exactly the same problem .. this is a Blackberry Enterprise Server Express 5.02 SP1 issue I think.. plus the misfortune of a power failure (or a corrupted BESMgmt SQL DB from any other cause)... together with a malformed PATH variable... you have to be pretty unfortunate to have exactly the same symptoms... :)

I did wonder if it was a recent Windows Update that wrote the PATH variable incorrectly...  it appears to be somewhat common... I don't think people write "C:\System32\wbem" .. but someone has written: "%SYSTEMDRIVE%\system32\wbem" instead of "%SYSTEMROOT%\system32\wbem"

Let me know if that's the work of a virus ... that's the one thing I didn't bother to look into...

Friday, 3 June 2011

Paint.NET - can't update or remove 3.5.5

I appear to have been having problems updating Paint.NET.

I have version 3.5.5 and every time the installer runs to update I get an error about a missing MSI file in
C:\Program Files\Paint.NET\Staging.  Filename: PaintDotNet_753582080.msi.

Perhaps the Paint.NET team introduced the Staging folder after 3.5.5... who knows... some suggestions on forums:

  • Uninstall completely - does not work because you cannot uninstall it...
  • Hack the registry - I guess that might work, that would have been my last option :)
  • Rename one of the existing MSI files in the Staging folder - it only works if the MSI is the same version as the version that is installed.
  • Use the Windows Installer Cleanup Tool - now called the 'Patch Registration Cleanup Tool'? - you could ... but I have a cleaner solution...
How to update Paint.NET when asked for a Staging MSI:
  1. Find out the version that is installed. - Mine is version 3.5.5
  2. Go to File Hippo and download your current version.
  3. You need to unpack the MSI from the downloaded EXE... run from a cmd.exe window (or Start Run):
    Paint.NET.3.5.5.Install.exe /createMsi CHECKFORBETAS=0 DESKTOPSHORTCUT=0
  4. Open the folder created on your desktop, PaintDotNetMsi, and rename the file PaintDotNet.x86.msi to PaintDotNet_753582080.msi or whatever filename Windows Installer is asking for.
  5. Copy the MSI to C:\Program Files\Paint.NET\Staging
  6. Re-run the Paint.NET update - or uninstaller.
Mine has just finished updating itself... and I now have 3.5.8 --- albeit after weeks of hoping that each next installer would sort itself out :) .. finally I have got round to fixing it myself ...

Monday, 25 April 2011

Windows - No Disk - unhelpful Error Help messages

Windows - No Disk
Exception Processing Message c0000013 Parameters 75b6bf9c 75b6bf9c.


I am trying to run a QuickBooks QBFC 10.0 C# application and every time it tries to BeginSession I get this error...  Continue / Try again / Cancel...

I presume the "No Disk" error could indicate that there's a link to a file missing... nothing has changed...

Whilst searching for a solution I discovered www.wiki-errors.com - a good idea I thought - but 1) it took this meaningless error and threw a load of meaningless rubbish back at me... I am no wiser why the problem occurred and I have now spent another 10 minutes reading something that didn't help... 2) I can't edit the Wiki at Wiki-errors.com ... doesn't that defeat the purpose of a wiki?  I can't see how I can sign up and edit it either...  a truly beautiful social solution would be to allow lots of technical minded people look up an error and add our experiences to the solution... I want to edit that page and tell my solution...

but no.. I have now added yet another blog post to the massive number of blog posts about the "Windows - No Disk" error that is probably not very useful to anyone unless they happen to be developing QBFC10.0 in C# and one day their install goes tits up...

Quick solution:  If you're using a third-party library and developing software... just reinstall the software... see if that helps...

Actually I am not sure that was the answer now... there's a property on the referenced Interop.QBFC10lib.dll

  • Embed Interop Types = True / False - I changed this from True to False as well as re-installed the underlying library... so either change could have resolved the problem...
[Edit]
Just when I thought it was all fixed up... I now get the error again... it's gone from working to not working in the space of a blog post.

Well on further reading through the internet sludge... I have switched back to debug again... when I press Continue my program does actually run... it was not obvious at first because the program returns no data on first run at the moment, whereas it would have done a week ago, I forgot...  so stepping back through the pages, I can actually see data.  But I get the No Disk error every time I begin a session with QuickBooks.

I've got a couple of USB storage devices plugged into this laptop: an external USB HD and my printer has a card reader.  When I disconnect my printer, the error goes away.  When I connect my printer the error returns.  The external HD makes no difference.

Recap.. my printer's card reader is throwing an error in my C# QBFC10lib project when I try to create a session... because there is no sd/cf card in the printer.  That's crazy... How on earth do I prevent this on user's computers... I am calling the BeginSession with a blank field... that's supposed to find the QB file that is currently open.  So the QuickBooks SDK  is calling a Windows function, that is returning a 'No Disk' error... shouldn't QuickBooks deal with that?

Why provide us with a function that will bomb out randomly?

New Solution:   Don't let QBFC10lib search for the file you need to access.  Specify it.

Now to fix this inconsistent accessibility error (compiler error CS0051)...
Inconsistent accessibility: parameter type 'type' is less accessible than method 'method'

Resolved... seems that if you declare a public method, then all the types used as parameters must be declared public too... like selling a DVD of a film to everyone and only allowing the film to be played by DVD players in the right region...  or like distributing a software library which will bomb out randomly under certain unhandled circumstances...

Tuesday, 21 December 2010

Google Apps Migration

I added a new Page - to my blog - Google Apps Migration Checklist - a checklist of all the Google services that I had been using / or that one could use... and how I manage to transfer data from the standard accounts to the Apps account.

I did have a google Profile... but I can't access it anymore... it links to my Picasaweb which I also can't access...  It's said that there are no Profiles or Buzz yet in Apps - so my only task would be to delete that profile and free the profile name?

The trouble was that I had a Google Apps domain - oliverslay.com.  I already had a standard account @gmail.com ... When I tried to use Picasa or Profiles or other.. using my main email address, which was now in my Apps account, Google created a standard account with my oliverslay.com email - a third account! - through which I could access services not in Apps at the time.

When they expanded the services for Apps users this month, I had to give the account tied to my main Apps user, a different email address... and I gave it another address within my oliverslay.com domain..... I think... but now I cannot access that account.  The Profile has in the URL, oliverslay ... and Picasa has my name on it... I would like to use them...

I used Profile to send myself an email... the address on the profile sent a message to me.. and I received an email saying the message was sent... aha... it was sent to a different domain attached to my oliverslay.com Apps account... that means I can log in and transfer data across... phew!...

An AdWords account can have any user attached to it... and any number of users to administrate it... but a single email address cannot be attached to more than one AdWords account.  That needs to be understood when switching accounts around.  If you log into AdWords it will open a new account... so now, no-one can make you an administrator of their account.  I had to create a new user... give them administrator access to my new account, grant them access... then log in as them and terminate my own access to that AdWords account... just so my email address was now free to be attached to my client's account.

Trouble is, I discovered there's something called My Client Center - where you should be able to add various accounts in order to manage them...  http://www.google.com/intl/en/adwords/myclientcenter/  - So now I will have to terminate my access to my clients account and try again...

I was lucky with YouTube... YouTube had their own accounts before Google took them over.  I had a YouTube account and one day I associated that account with my standard GMail login... I found that I could disassociate it from my account, log in using the old YouTube account (the username and password of which you have to be able to remember) and then associate with my Apps account.  My brother was not so lucky... he never had an original YouTube account - and would be forced to re-upload his videos to his new Apps address and he'd lose his YouTube nickname...

Google Apps must be causing a lot of people a lot of headaches... it's not straightforward what can be done and what can't .. and nowhere is it made easy...

Sunday, 28 November 2010

old HP nx9005 - Win7

Finally I have Windows 7... installed on an old nx9005 - perfectly good laptop with a working OS... bit worn around the edges.. but why should I throw it?  The only thing that I've had to do with it in the past is install a new HD.. cos the Fujitsu one in there before developed the strange clicking problem... and I lost everything on it.. or perhaps I didn't .. I'm keeping it just in case, but I reckon it's got about 5 seconds of read time left if it ever does boot up because of my insistence on taken things apart .. :)

Maybe i can just replace the read head with an exact same disk.. ?  I'm sure there's a disk recovery place somewhere in Ireland or Wales that can retrieve data from clicking drives.. I read a review once...

Anyway.. drivers.. Conexant AC97 - wouldn't work in Win7... and HP are rubbish, they won't even develop anything for the nx9005... which is really really stupid... because the solution I found on MSDN Social Forum is merely a change in ONE LINE...  why on earth HP can't simply re-package the driver as Win7, with a single line edit (like I reckon MS used to do with DLLs between major Window's versions) .. Is it just down to Windows Compatibility signing?  My system didn't seem to care...

The solution is on here... by Mr. Raven...
http://social.technet.microsoft.com/Forums/en-US/itprovistahardware/thread/2857c5ef-bc13-49ce-bdd8-99bddb7d6b10/

It simply involves downloading the driver from HP - unpack and don't install:
http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-31530-1&lc=en&cc=us&dlc=en&product=1816346&os=228&lang=en

Then edit the INF file... find the [Conexant] section and add a new line with the PCI bus enum that Win7 has assigned to your sound card... can be found in System Properties -> Device Manager -> open Sound Device -> Details tab -> Hardware Ids from the drop-down.  Mine now looks like this:


[Conexant]
%*WDM_AMCAUD.DeviceDesc%=WDM_AMCAUD,PCI\VEN_1002&DEV_4370&SUBSYS_3091103C
%*WDM_AMCAUD.DeviceDesc%=WDM_AMCAUD,PCI\VEN_10B9&DEV_5451&SUBSYS_0024103C

So I wonder could you do that with most drivers?  I guess you could try... Download the WindowsXP driver, find the INF file.. find the manufacturer section [Conexant] ... and add the new line...

Only a few things change drastically between versions of Windows... and then they're re-marketed...

DrWatson was really quite useful in Windows 3.0... Windows 3.1... Windows for Workgroups... and then Windows 95 came along.

As I installed it, I was told that Windows 95 now comes with new! Dr Watson which would handle crashes...  rubbish... Windows Server 2003... comes with DrWatson....

Windows XP: [system32]\dwwin.exe 10.0.5815.0 - Microsoft Application Error Reporting - Original file = DW.exe
and DrWtsn32.exe - which has a user interface... for reading dumps... I couldn't find a dump to read...

Microsoft were originally going to call this Sherlock...  wonder why they didn't... maybe they couldn't get it past their legal team...

Apparently DrWatson has now been replaced by Problem Reports and Solutions...  but you can still type DrWatson into Start->Run (WinKey+R) ... or dwwin ...

Friday, 26 November 2010

Quickbooks SDK and Quickbooks Pro 2005 (UK)

I seem to have dived into the deep end... there are many versions of Quickbooks... and many versions of qbXML... many versions of QBFC ... and QBXMLRP ... slowly I think I might be getting my head around these ...

I've just got my code to open, begin, end and close a session with an open copy of QB Pro 2005 (UK) .. only to spend hours struggling to find out why I am getting all these "Unrecognised qbXML Version".. or "qbXML Version not supported"...

After every possible combination of SessionManager.CreateMsgSetRequest("", _maxQbXmlVer, _minVer)

Finally someone has talked some sense... QBFC10 DOES NOT SUPPORT UK3.0 ... ah... that's why I get "Country Code Incorrect".  Ok .. what does?  Hmm it appears that QBFC5 might be the only one that ever supported UK3.0...

One blogger, Doug Vanderweide, laments: "the quickbooks SDK, one of the sorriest, worst-documented excuses for a programming tool I've ever encountered." - I totally agree... I've been sitting here for 5 hours at least, and I've got so little done compared to nearly every other SDK I've ever used (perhaps apart from one mapping COM component - an early version of CadCorp).

Is it worth me plodding on?  The handy QBFC10 functionality is not available to QB2005... the client will be upgrading to 2010/2011 in the next 6 months... Let's first see if I can squeeze some functionality out of QBFC5... then have a quick go at using the QBXMLRP...(qbXML Request Process - basically XML-SOAP)

Success - QBFC5 did it! it works with values ("UK",3,0) if anyone is looking for that detail - unlikely but then I was... 6 hours to populate a spreadsheet with Customer details from QuickBooks... 24 rows... I could have typed that in a few minutes!  Their other database has 20,000+ records... So let's move one step at a time...

If I could used QBXMLRP then I'd have access to version 4.0?  Or is that just the US version?  I think the UK version is still UK3.0...  Ok... well it's good to know for future reference, that we're quite limited in what we can do if the client has a version less than QuickBooks 2008/2009 (UK) (qbXML v6).  QuickBooks 2010 UK supports up to qbXML Specification version 8.0. (US versions support up to 10.0)

right.. now to move the whole thing from Excel to Visual Studio.NET 2010... maybe fill some entities instead of the spreadsheet...

there are two QuickBooks SDK integration tools available that take all the pain from using the SDK - by RSSBus and n/software... but the one thing lacking from their websites was any indication of whether it would work with my version of Quickbooks... or any version... I think that should be made more obvious... I wasted enough time with the SDK... on top of that I wasted more time messing around with trial software that just wouldn't work on my version... I don't even know what versions those tools work on... it's near misleading, given the number of versions of Quickbooks still in the wild...  and these tools AND the SDK would help us out a great deal if it said - "Error: this SDK WILL NOT work with your version of Quickbooks in your country"

Saturday, 20 November 2010

Macs - Entourage - Split DNS - SBS2003 - Cisco 1841

Here's a question...

In this client's domain, there are a couple of servers.  Both SBS2003.  It is set up with an internal mydomain.local address.

The server has an external name - mail.mydomain.com.

The Macs have been set up with WebDAV and Entourage... and point to mail.mydomain.com... so on the SBS2003 DNS Server, mail.mydomain.com has to be defined as the 192.168.0.2 address of the server.  If it is not then the request for mail.mydomain.com is forwarded off to external DNS servers, which returns the address of the external interface of the Cisco 1841 router...

Clients on the outside can see mail.mydomain.com ... but they often open a VPN connection to the Cisco 1841 router... the router gives them a DNS of something.. it's own DNS proxy perhaps?

So the client has a network connection somewhere in the world... with DNS local to that ISP... they connect to the VPN and are given an IP address of 192.168.0.x ... and DNS is something...

but they can no longer connect to mail.mydomain.com ...

Is there an easy answer?   My only answer so far is to look up CCNA courses nearby... :)  The company who should look after this router want £NNN for a solution they can't guarantee will work... And it's not a client we want to mess around with... it has to work or not.

Sunday, 14 November 2010

SBS2008 and the mysterious DNS drops: Resolved

I finally managed to get onto the router... a Draytek Vigor 2900... I looked through all the settings and found nothing timing out.

Looking through the Ethernet log... I could see one PC calling up numerous destinations on the internet, TCP/UDP port 16650 and destination in the 50,000s... 57874.?

I found out the PC name on the network and connected via Explorer to the admin share to look at Program Files and see if there were any nefarious software installed... 

BitTorrent... oh dear... Dates of the files appear to match the times of the DNS dropping out.

I was called at the time, their DNS has been down for 2 hours whilst I was investigating.  So I blocked all traffic from that PC's IP address to the internet.  Immediately I could browse to www.google.com on the server.

My colleague gets a call from one member of staff... everyone's internet has come back except hers... he let her know we'd look into it...

So I blocked all traffic up from 1024 to 65535 from that IP address... at least she'll get mail, DNS, web surfing... but I think she might have a few more problems... downloading large files on company ISP.. killing an online application used by others that is the vital for the company... furthermore the size of the files over only 25 days could have had their ISP block all further traffic... Business Usage Policies n all that...

The router was still showing DNS calls to the internet... the Forwards were working.. but because of all the heavy torrent traffic, all DNS calls were timing out.  The DNS Forwarding has a timeout of 3 or 5 seconds.

BitTorrent is known to kill a connection when it's not been limited in the torrent app... 

So restarting the DNS Server on the SBS2008 box was simply killing the torrent connection and then it would all start going again .. and perhaps the only reason it's starting getting worse is because the user's PC was set to go directly via the router?  SBS2008 was limiting the Torrent connections.. once it was out of the picture the torrent was allowed to keep the connection killed and restarting the DNS Server no longer had a lasting effect.

Staff should be kept aware of the company's internet policy... and some should know better.

The answer is always so simple in retrospect.

Friday, 12 November 2010

SBS2008 and the mysterious DNS drops

I've been asked to look into an install of SBS2008 which is occasionally failing to forward DNS requests from clients. Apparently there are two workarounds. 1) A registry change and 2) set up forwarders to DNS servers... My colleague couldn't remember the details...

Hmm.. Google: 945 results from EggHeadCafe alone for SBS2008 DNS. 118 in the past year. 22 in the past month. None in the last week... so it's a dying topic...?

Is XP losing its binding to the DNS Servers in DNS? Is SBS2008 failing to forward the request? There are some Mac OSX... is Mac OSX losing its binding to DNS?

Restarting DNS solves it... so DHCP is not a problem and the problem can't be on the client-side because restarting DNS on the server wouldn't fix it. All clients are affected.

Event Log... DNS.. the Event ID sequence 3,2,4 (DNS Shutdown/Start/Ready) have occurred frequently over the last few days, and every 2 or 3 days for at least a month back... That has to be a manual action, doesn't it?

Apparently a user is restarting the DNS service... and has been for some time... I've gone through the log and noted into Excel the date and time when the user has restarted the DNS Service... then convert that into a simple dot chart...


The clumping is occurring with 2 day intervals between the events... except the last clump which is occurring more frequently because of a 'fix' put in place specifically to correct this... it's a weird clumping... 2 days later the users experience the same fault but about 30 mins later in the day.  It recurs 2 days and 30 minutes after restarting DNS?  That would equate roughly to a TTL, somewhere, of 2900 (rather than 2880)...?

These events occur between 09:30 and 20:10 purely because no-one is around to restart the DNS outside of those times.

FRS (File Repl. Svc) reported space issues (almost daily) on C drive between 23rd Oct and 1st Nov... but there are about 30gb free on C drive now... Shadow Copies is using its maximum of 10gb...
(Note if space is an issue then DNS might be prevented from working properly...)


Event Source: NETLOGON      ID: 5781
Description:
Dynamic registration or deletion of one or more DNS records associated with DNS domain 'DomainDnsZones.mydomain.local.' failed.


Possible causes of failure include:  
- TCP/IP properties of network connections contain wrong IP addresses of the preferred and alternate DNS servers 
- Specified preferred and alternate DNS servers are not running 
- DNS server(s) primary for the records to be registered is not running 
- Preferred or alternate DNS servers are configured with wrong root hints 
- Parent DNS zone contains incorrect delegation to the child zone authoritative for the DNS records that failed registration  


There's one of these for each DnsZone... and these appear when the DNS service starts up on the SBS2008 server.  But they occur when the service starts so they are related but not a cause.  They occur simply because the NETLOGON service doesn't receive a 'Success' signal back from the DNS Server that owns the zones of the records that are being registered.  The zones in question are owned by this server?  So this server is not responding to itself?

I've just discovered a utility called DNSLint.exe from Microsoft via (I won't repeat it here):
http://www.computerperformance.co.uk/w2k3/services/DNS_dnslint.htm

Hmm.. DNSLint on 2008?  I have no DVD to hand...  DNS Tools:
http://technet.microsoft.com/en-us/library/dd197560(WS.10).aspx

ok.. back to error 5781 - it appears that this only occurs when the DNS service starts because the server's DNS on its own network connection is pointing towards itself... and since the DNS service hasn't yet begun, it can't register on that server... so I'm going to ignore that ... you can make the NetLogon service depend on the DNS service... http://support.microsoft.com/kb/259277 but it'll try and re-register 5 minutes later anyway.

After some searching around I've found a couple of root-server addresses in Root Hints that are using IP addresses for l.root-server.net. from 2 years ago... maybe the tech at Microsoft who put SBS 2008 together didn't know?  Resolve all the Root servers to check...

Also I switched off DNS from listening on IPv6 interfaces for DNS requests... nothing IPv6 on the network... if so I'll find out tomorrow.

I also found a registry entry in HKLM\Systems\CurrentControlSet\Services\DNS\Parameters... called MaxCacheTtl... the MS KB (http://support.microsoft.com/kb/968372) says it's MaxCacheTTL ... does it make a difference?  I could get ProcessSpy running to see if DNS Server on SBS2008 is making calls for MaxCacheTTL or Ttl... it's set to 172800 seconds = 2880 minutes... which is the timeout value I questionned earlier... (2900 minutes = 2 days and 20 minutes) ... what about the 20mins?  It's 2 days and 20 mins between restarts of DNS... so that's 2 days for the TTL and 20 minutes for the users to realise something is wrong and restart DNS again...

Is this TTL value killing the DNS?  Can it?  We'll find out tomorrow... or in 2 days time...  Then we'll find out if it's a problem with AVG or not.. :)  or perhaps it's the router...

Friday, 29 October 2010

MS Access: How to prevent trailing spaces from being trimmed.

(jeez .. when Blogger's spacing goes haywire it really goes haywire... "remove formatting" converts a single carriage return into about 20... how many times do I have to edit this?)

Microsoft's KB Article says:

ACC: Trailing Spaces Automatically Truncated During Data Entry http://support.microsoft.com/kb/95009

Microsoft Access automatically truncates (or strips) trailing spaces on data that you enter in form controls to prevent the creation of a record that cannot be referenced because of accidental space character(s) being appended to the end of the text.

This behavior is by design.

1. Enter the following for the field's ValidationRule property: ="a "

2.Enter "a" (without the quotations marks and no space) in the field. Note that you do not receive a validation-rule-violation message.

The problem I have is that I have an unbound TextBox and I type a string of characters followed by a space... and then Access' TextBox removes the space as soon as I tab out of it... You can't switch this Behaviour (by Design) off...

Don't use Access databases is the most common answer... Altho I have seen others:

1. why would you need to do that? - which then goes on to describe how you can add strings: string1 & " " & string2 .. if you happen to want to concatenate strings... thanks .. but no...

2. use ALT 0160 to enter a character that looks like a space... hmm.. well then the search I am doing won't find the space I am trying to match... and I can't go through the database replacing spaces with 0160... and I am definitely NOT going to tell all my users .. oh just press ALT 0160 ... oh yes.. you have to use the number pad... oh yes, you have a laptop.. you have to press Function KEYPAD .. then ALT 0160 .. then Function KEYPAD to switch off the number pad... it took 4 answers to explain some of that in the following forum...

http://thedailyreviewer.com/office/view/preserve-trailing-space-entered-into-text-box-103342802

3. "I personally can't think of a reason to store trailing spaces." - that's my favourite... Solipsist argument #1 ... I can't think of a reason why you want to do that therefore you do not exist. :) And here's a solution to another problem... see if that helps you...

Well the answer is ... you can't switch this behaviour off... because for the most part Microsoft want you to have text fields with no trailing spaces... and no mistakes...

Elsewhere you would correctly trim all your entries where you need to... but in Access you don't need to because Mother Access ties you laces for you...

Here's the issue...

I have a database... (and for now it's going to stay as an Access database, because there's no money to pay me to write a .NET application to replace it... there's money to patch up...)

I have a Search Form. On that search form I have lots of TextBoxes. The user wants to search on "SE1 " with a space! They enter "SE1 " - they don't want to enter SE1~ALT-0160~... The tab to the next control... or press Search... and immediately Access has corrected this unbound control back to "SE1"

If they enter "SE1", then the search returns "SE1 2WR", "SE11 1JR", "SE12 2BN", "SE1 9XZ"
If they enter "SE1 ", the search returns "SE1 9XZ", "SE1 2WR"

This works so well in a C#/VB.NET GUI... Why has Access TextBoxes decided to do this?

My answer is a simple one... (and perhaps only solves my problem...)


Private Sub Postcode_KeyPress(KeyAscii As Integer)
   If Chr(KeyAscii) = " " Then
      KeyAscii = 45
   End If
End Sub



This stops the user from entering spaces into a TextBox on an Access form. There are NO dashes - Chr(45) - in UK Postcodes.

Then in the search I must replace the spaces in the Postcode with dashes also... to check - to prevent Access from ignoring spaces in search strings...


If Left(Replace(rs("postcode"), " ", "-"), Len(Me.Postcode)) = Me.Postcode Then
   ' Add to results
End If



I've been testing this for an hour or so and it works well... good for finding Postcodes in the UK anyway...

It could be used to search on spaces in other data fields as well... so long as '-' is not used... but then a different character can be found to replace that...

Friday, 22 October 2010

Google is so slow...

I appear to be waiting too long for Google to return results .. or for the page to complete...

In the late evenings when searching for general images, all I see is a grid of grey boxes... Sometimes the page doesn't change... I have to hit Enter on the URL 1-4 times before the browser even appears to react... and after a few minutes of working with Google Maps tiles stop loading and the whole thing comes to a halt...

Switch to Bing / Yahoo / Multimap / Streetmap.co.uk and there's no problem...

Why is Google slowing down? It's not just me... I did have Chrome Dev installed.. so i removed it from my system completely and reinstalled... and I still have problems... It happens on my spare laptop... so it's not my computer... I no longer have any plugins because I clean-installed Chrome...

DNS? - On my router, I'm using Google DNS - 8.8.8.8 and 8.8.4.4
Everything we do on the internet requires some DNS lookup... I just ran Ping on a few DNS servers... checking the average of 20 pings... (all 0% loss)

For 8.8.8.8 and 8.8.4.4 Google DNS
Minimum = 31ms, Maximum = 33ms, Average = 31ms
Minimum = 30ms, Maximum = 32ms, Average = 30ms

For 208.67.222.222 OpenDNS
Minimum = 23ms, Maximum = 26ms, Average = 24ms

For 212.159.13.49 and 212.159.13.50: My ISP
Minimum = 24ms, Maximum = 31ms, Average = 24ms
Minimum = 25ms, Maximum = 34ms, Average = 26ms

Google DNS promises speed and other functionality... by comparison .. I don't see it.. and I reckon by other functionality - they mean they can track where I go and what I do... and improve Analytics for websites and which AdWords are targeted at me throughout the day...

Only 4 hours ago I also ran the DNS test.. but deleted the results... the average was 70ms with minimum ~50ms and max ~180ms... This was the same for Open DNS... and I didn't test my ISP in time. I was distracted by trying to work out whether I should move myself off the antique Broadband Package I am on and onto a new one... the up-to-date candidate package looks very similar - there's a very complicated hour versus service rate limiting chart to confuse me even further...

http://portal.plus.net/support/broadband/speed_guide/download_speeds.shtml#extraSpeeds
http://portal.plus.net/support/broadband/products/archive/bbyw/speed.shtml#Option2speeds

Looks like I'm on the better deal by a small margin...

I switched my DNS back to my ISP's name servers.... I don't think Google DNS is beneficial at all in the UK yet...  Has it helped?

Things appear faster... but it's early morning .. and one of those things with IT that it's the experience over the full 24 hours that counts... whether there's an impact at the times at which I work throughout the day... and on the work I am doing (VPN, VNC, RDP, HTTP, HTTPS, etc...)

If it makes no difference then I'm going to try switching off Web History and other tracking components... and clearing my Google History out... if we can...

Friday, 15 October 2010

iPhone and ActiveSync: Message received

So... the user received my test email ...

I think the order of checks if you have problems with iPhone and ActiveSync on Exchange:

1) Check the ActiveSync is working using Microsoft's Online Test Tool
2) Switch on Proactive Scanning and Background Scanning in MSExchangeIS\VirusScan.
3) Check timeout values on all routers under your power. If possible, make the value greater than the MaxHeartbeatInterval registry setting in Exchange. (See previous post). (If not possible, perhaps make the Exchange MaxHeartbeatInterval just lower than the router timeout?)

No doubt he'll update to iOS4.1 soon and we'll get yet another problem...

Wednesday, 13 October 2010

iPhone and ActiveSync: Antivirus Proactive Scanning

And now I don't just have intermittent scanning... Now it only gets emails when the user opens Outlook...

Something has been cleared up by setting the router timeout to a larger value...

And opening Outlook causes the Antivirus to kick in on the messages. Exchange won't do anything with the messages until they have been scanned.. and they won't be scanned without being accessed first.

Checking the registry for the VirusScan settings...

HKLM\System\CurrentControlSet\Services\MSExchangeIS\VirusScan

The ProactiveScanning should read 1 - BackgroundScanning should read 1... then change ReloadNow to 1 .. and MSExchangeIS will reload... wait a little bit and press F5... ReloadNow will have been changed back to 0.

Now let's see if this works... Finally... (Combined with the timeouts in my last post)

Tuesday, 12 October 2010

iPhone and Exchange ActiveSync: Heartbeats

In an earlier post I mentioned there are two Heartbeat settings Min and Max:
  • MinHeartbeatInterval - Dword - Decimal 60 (seconds) 
  • MaxHeartbeatInterval - Dword - Decimal 2700 (seconds) 
  • HbiSampleSize - Dword - Decimal 200 (samples) 
  • HbiAlertThreshold - Dword - Decimal 480 (seconds) 
My Vigor 2900 router HTTP TCP SYN setting was 900 seconds. But clearly if the maximum Interval can be 2700 seconds (45 minutes), then it is going to fail...? Should I set the router's TCP SYN setting to 2700 seconds?
Ok... at the end of the Heartbeat period... the EXCHANGE server replies to the PHONE with a 200 OK message. This should force the iPhone to send another ping with a new (but more than likely same) heartbeat value.
What if the iPhone does not receive this 200 OK message. Perhaps the signal has dropped in a tunnel, for example? TCP/IP is best effort after all... that is the last message required of the Exchange Server.
The iPhone should assume that the period is up... and resend a new Ping anyway when it can? No? Right.. sort of .. the iPhone also calculates the best Heartbeat based on it's history of connections to the Exchange server.
So what if ... I am in the office... and my phone connects up... iPhone can create a longer and longer heartbeat period, up to 45 minutes (2700s)... and then I leave the office... and now the iPhone is not only waiting 2700s for the 200 OK... the phone has disconnected... the server tries to contact the iPhone in the office... nothing happens.. there must be confusion when switching between WiFi and OTA (over the air) ...
But also the HeartBeat period is continuously being cut off by the Router - set to 900s (15 mins)... So how long will it take before the iPhone's connection algorithm chooses a Heartbeat Interval that is smaller than the shortest timeout along the route to the server? Does it say... ok nothing back in 2700s .. lets try 2640s... lets try 2580s .. lets try 2520s ... and so on... which could take more than 6 hours! until finally reaches the correct value.... or does drop back to 60s then increase until it finds the best timeout value?
If for 6 hours or more... the timeout is greater than the value of the router timeout, then if emails arrive in the inbox after 15 minutes.. the server cannot tell you... because the router has shut the session... and the iPhone won't ask until the Heartbeat is up...
There'll just be the assumption for the iPhone that no emails arrived... and perhaps the Exchange server will just shrug and say, "well, I sent you the emails... don't look at me..."
I'm going to up the router to bigger than 2700s...