Tuesday, January 09, 2007

The Dreaded Access Date Bug

I use Microsoft Access 97 a lot. It runs well on Windows XP and all previous versions of Windows since it was released. The only problem is that its date system is very, very broken in one respect: it only understands the mm/dd/yyyy format. Anytime you use dd/mm/yyyy you are asking for trouble.
Today's date of 08-Jan-2007 will transpose into 01-Aug-2007 or 07-Jan-2008 in the blink of an eye, even if you are very careful. Try this
Dim dtmDate As Date, strDate As String
Const MY_DATE As String = "08-Jan-2007"
dtmDate = DateValue(MY_DATE)
strDate = Nz(dtmDate, Date)
Debug.Print strDate, dtmDate
Debug.Print Format(dtmDate, "dd-Mmm-yyyy"), Format(dtmDate, "Medium Date")
The displayed values are:
08/01/2007    08/01/2007
08-Jan-2007 08-Jan-07
So far so good, you may say. Actually not. Every time a date is converted to a string, or a string to a date, unless you specifically state otherwise, the "mm/dd/yyyy" method is used.
Change the "08-Jan-2007" string to read "08-Jan-07" (i.e. what "Medium Date" is displaying, and the result changes to:
07/01/2008    07/01/2008
07-Jan-2008 07-Jan-08
Confused? I was. You can't set "Medium Date" in International settings either. My "Short Date" setting is always set to "dd/MM/yyyy". After all, I'm using the Metric units system, and the UK English dictionaries, and an A4 page size. So never use "Medium Date"; always specify it as "dd-Mmm-yyyy" instead.

What to make it worse? Try getting the value of a date control from a form, even if the format of the date control is "dd-Mmm-yyyy". If you try something like this:
    dtmDate = nz(frm!MyDate)
The answer will be wrong, because somewhere in this process the value of the control is onverted from a date to a string, and then back to a date. The only foolproof way of doing this is to change the code to read:
    dtmDate = Format(frm!MyDate,frm!MyDate.Format)
Then, provided you set the control format to "dd-Mmm-yyyy" it will work right every time.
Now for the really fun part: you can replicate these errors in Access 2002. I'm willing to bet that the same problem will be reproduced in Access 2003 and Access 2007.
Update: the bug can be repeated easily in Access 2007 SP1 (12.0.6211.1000). Just change your regional settings to "English (South Africa)" and your short date to "dd/MM/yyyy" in either WinXP or Vista.

Monday, January 08, 2007

Go Banking Ignores Privacy Law

Today I was called by some marketing drone from Nedbank's Go Banking call centre, offering me a credit card. I have already informed Nedbank that I do not wish to receive any marketing calls, yet they don't want to listen. That makes the call illegal, if not downright annoying. I have complained again, with reference number "FI258111 - Jan 8 2007 11:32AM"
Are these people so dimwitted that they don't realise the legal implications of continually phoning me? They have already lost out on a home loan from me, and at this rate they'll never get any business from me in future either.
Why illegal? The ECT Act makes it illegal for any business to make any kind of unsolicited communication when the (potential) customer has already indicated that he does not wish to receive such communications. Section 45 of the Electronic Communications and Transactions Act, no 25 of 2002. states the following:
45. (1) Any person who sends unsolicited commercial communications to consumers, must provide the consumer—­
(a) with the option to cancel his or her subscription to the mailing list of that person; and
(b) with the identifying particulars of the source from which that person obtained the consumer's personal information, on request of the consumer.
When will the banks learn? I guess in the next decade or so, once they have had to explain to their shareholders why the Marketing Director had to go to jail for a year. Marketing Departments spend so much time talking that they don't listen. That's why the Nedbank Marketing department doesn't publish its email address.
Update 9-Jan-2007: Go Banking responded to the HelloPeter complaint, and have apologised. It remains to be seen whether the rest of Nedbank gets the message.

HelloPeter complaint

Friday, January 05, 2007

Extreme Diet Coke, Mentos Experiments

The guys from EepyBird are back, with 251 bottles of Diet Coke and over 1,500 Mentos mints. In Experiment #137, they did a mint-powered version of the Bellagio fountains. This time, it's one giant Coke and Mentos chain reaction that has to be seen to be believed. This video was voted best blog video of 2006.

Thursday, January 04, 2007

Suicidal Windows Vista Content Protection

"Windows Vista includes an extensive reworking of core OS elements in order to provide content protection for so-called "premium content", typically HD data from Blu-Ray and HD-DVD sources. Providing this protection incurs considerable costs in terms of system performance, system stability, technical support overhead, and hardware and software cost. These issues affect not only users of Vista but the entire PC industry, since the effects of the protection measures extend to cover all hardware and software that will ever come into contact with Vista, even if it's not used directly with Vista (for example hardware in a Macintosh computer or on a Linux server). This document analyses the cost involved in Vista's content protection, and the collateral damage that this incurs throughout the computer industry."
"The Vista Content Protection specification could very well constitute the longest suicide note in history."
Update: This paper is discussed and partially explained in the Security Now podcast #73 and #74. The letter includes an interview with the author, Peter Gutmann.

Tuesday, December 26, 2006

Audio Apartheid Extended to Botswana

Even the indomitable Mma Ramotswe would have a few words to say about this conundrum: citizens of Botswana, the home of the No 1 Ladies Detective Agency, are prevented from buying and downloading audio books about its most famous detective.
Why? Because the publishers in their infinite wisdom, and for reasons known only to themselves and perhaps Alexander McCall Smith, have determined that these audio books shall only be sold to customers in the USA and Canada. The titles are not even available in the author's home of the UK, let alone anywhere in Africa. It's another form of Apartheid, only this time most of Africa, including South Africa and Botswana, have been reduced to "Bantustan" status, meaning that they are excluded from the global marketplace. It's comforting to know that the UK is also regarded as a "Bantustan" in this case, but it still doesn't eliminate the sheer injustice of it all.

Sunday, December 24, 2006

Santa's Car Spotted in Parking Garage

We arrived in the covered parking at Cresta shopping centre this morning and spotted this car. The picture was taken with my Nokia cell phone. I guess even Santa needs to stock up on last minute goodies. Foreigners may not understand but "GP" doesn't mean he's a doctor, it means he lives in Gauteng.
Merry Christmas and a Happy New Year everyone!

Friday, December 22, 2006

Down with DRM!

Increasingly, music lovers are becoming fed up with competing rights management schemes for digital players like iPod and Zune.

Fred Benenson spent a recent drizzly Saturday afternoon with friends in Manhattan wearing yellow hazmat suits. They were in front of the new Apple store on Fifth Avenue, distributing flyers and explaining to passersby why iTunes, Apple’s online music store, “sucks.” The target of their ire: a technology the recording and film industries call “Digital Rights Management.” DRM, as it’s known, is encoded onto downloadable digital content so that copyright owners can prevent piracy. But it also prevents people from transferring downloaded content as they might like. Since different companies use different DRM technologies, an iTunes-bought song can’t be moved to a Zune, Microsoft’s new answer to the iPod, or even e-mailed to a friend. Since the vast majority of online music is sold on iTunes, “Apple has a stranglehold,” says Benenson, 23, a graduate student at New York University’s interactive telecommunications program. “There are some musicians who I like who will only offer music on the iTunes store.”

Music: Fans Mad at Anti-Piracy DRM - Newsweek Entertainment - MSNBC.com

Wednesday, December 20, 2006

Audio Apartheid

Book publishers are a weird lot, and seem to have no qualms about carving up the globe into pieces and then treating each piece differently. That's why I call it Apartheid. There are other words to describe it: "regional segregation", "economic discrimination", or even plain racism. Call it what you will, it sucks. Here's a recent example:
I can buy this audio book from Audible.com, which happens to be the best source for audio books on the planet. But if I want the unabridged version, I get this response:

Now I know that Audible doesn't like it, but until now their approach has been "there's nothing we an do about it". In their own words:
When publishers decide to publish a work, they acquire the rights to distribute that title in certain parts of the globe. Sometimes they buy "world" rights, but frequently the rights for a book are split among several companies, each of whom publish for certain countries. As a distributor, we need to abide by the restrictions that publishers assume when they publish a work. Thousands of our titles are available for "world" distribution.
Their management knows this is a problem, but at the moment they feel powerless to deal with it, because they are dictated to by their suppliers. It's time for their customers to dictate to their suppliers. I just have to figure out how.
Apple, on the other hand, is just plain arrogant in their approach: they won't even let me sign up to their iTunes store, even though I own two iPods, sold to me in South Africa through official distribution channels. When interviewed on 702, the MD of Apple SA said there is nothing he can do about it, he's only the distributor. That sucks! I'm his customer, and he throws his hands in the air.
So not only does Apple make buggy software, they just couldn't give a damn.