13 November 2009

What's wrong with Microsoft - now I know

It came to my attention the other night through that celestial medium that we call Television, just why Microsoft are failing in their current endevours.

Yes I saw a strange unknown person in a commercial broadcast revealing the problem. They (an inexperienced home user) had been allowed to influence the development of Windows 7. Obviously we are seeing the people who made the popular decisions, like "make it easier to stream my video files to my TV" as the man in the advert claims to have suggested.

I would like to hope that somewhere in a Microsoft snuff film is the person who suggested "lets change the name of the add & remove programs icon in the control panel and call it something nobody will expect". I also hope there's one featuring the "lets replace the established menu system in Office with a frequently changing ribbon". There must also be enough DVD storage space for the "Let's make the SQL view in Access even more difficult to find and then make it disappear after switching back to table view" suggester.

So Microsoft, here's my suggestion. "Let's ask IT professionals what we should/shouldn't change before we release new products". I'm not saying that development isn't important, just that migration is easier if you don't drastically change the accessibility of core features for every release. Maybe every new product could have a "Classic view"... wow now there's a suggestion worth considering.

Why do I feel the need to rant about this you may be wondering? Well this week I have had to figure out why users were getting a fault with their PHP pages on Windows Server 2008 when connecting to an Access 2007 database. The problem was only made worse by the use of latest versions. Access 2003 with Server 2003 and I would have had the problem fixed in no time. So what was the problem? The "Operation must use an updateable query" error which is guaranteed to bring visitors to my blog as it seems lots of people are getting the same problem (please visit my links while you're here :))

The first idea I had was that it was a permissions issue. I checked and they seemed fine to me. Especially when I decided to fix it by giving all authenticated users permissions on the test folder. When this didn't fix things I went straight for the Everyone group and still the problem persisted.

Ok so everyone has read/write access to the folder & files, so surely it must be something in IIS7 causing the problem? Well it's so different from IIS6 that I wasn't sure where to find things. I stumbled along but nothing I did seemed to fix the problem. I looked at the code and it seemed fine to my highly experienced and knowledgable yet very tired eyes. I went back to opening the file in Access and that was when I noticed it. The database was opening and a lock file was created (database.laccdb) but when I closed it again, the lock file did not vanish. This meant next time the database was accessed, it was read only, hence the updatable query message. So the next question became why are the lock files still there when the script finishes?

After some Googling I found this site blueclaw-db - access_2007 security warning. This is where things started to get back on course. Opening the options and clicking enable content (in Access 2007) is enough to create the lock file which I couldn't delete and wouldn't vanish. I thought maybe my database had been virused so I created a new one from scratch and exactly the same thing happened with that.

Eventually I discovered the trust centre link at the bottom left of the options box. I went through this and enabled the network trust then browsed to the network folder where my database is. Adding the container folder as a trusted location allowed me to open the database in access and it started to release the lock file again when I closed it down. Success I thought!!!

When I got back to my PHP I noticed the lock file was still there and my code would not work. How do you get rid of that I wonder? I tried renaming it (access denied). I tried deleteing it (access denied). I deleted the database and set up another with a different name. Still the database.laccdb file would not go. eventually I Googled some more and came across the excellent Unlocker freeware program. I had to remote into the server but this handy utility finally released the lock file which then vanished (presumably into a namespace exclusively reserved for ex-MS product development executives). In the process it also told me which process was holding up the system, which turned out to be McAfee antivirus.

It's been a long week and they will only get longer until MS start listening to IT pro's and people like Cedrick Collomb, author of the unlocker utility. If he can write code that figures out what's causing my problem then why can't MS? Obviously they didn't send a TV crew around to record his suggestion. Thank God he can write code himself  :)