Posts tagged ‘Microsoft Access’

The Difference Between Null, Empty And Zero-Length Data / Strings

A common problem faced by new programmers is understanding the difference between null, empty and zero-length variables, especially when working with database records.

While, for most intents and purposes, the three things have the same effect — either you have some data you can work with, or you don’t — they arise from different circumstances. Understanding how null, empty and zero-length are different can help you avoid data errors in your programs.

The short version is this: If a variable simply doesn’t exist — usually because it hasn’t been declared, but sometimes because it hasn’t been assigned a value — it’s null. If the variable exists but contains no data, it’s empty. And if a structured data variable, such as an array, exists but doesn’t contain any items, it’s zero-length.

An analogy is in order.

Think of a database as a house. A house has rooms, and in each of these rooms are furniture and accessories that are appropriate to that room.

For example, the kitchen has a stove, refrigerator and sink. The bedroom has a dresser, bed and armoire. The living room has a couch, television and coffee table.

Continue reading ‘The Difference Between Null, Empty And Zero-Length Data / Strings’ »

My Experience Getting A Code Signing Certificate From Comodo

I have been working in VBA for Microsoft Office 2007 lately. And if you haven’t used it yet, I can tell you there have been significant changes in macro / VBA security versus Office 2003.

Basically, getting a VBA macro / module that hasn’t been digitally signed to run in Word 2007, Excel 2007 or Access 2007 requires the end user to go through a fairly complicated process — if his network’s group policies even allow unsigned macros to run — with many scary warnings against running unsigned code thrown in for good measure.

So I really needed to get a code-signing cert. And after looking around on the Web for places to get one, I settled on Comodo, via Tucows.

Tucows will sell a Comodo certificate for $75 per year, or $195 for three years — which, while not cheap, is less than half the cost some certificate authorities charge for a one-year cert, and a significant discount over Comodo’s published prices.

There’s not a lot on the Web about the experience and process of getting a certificate from Comodo, so I thought I would share some advice.

Continue reading ‘My Experience Getting A Code Signing Certificate From Comodo’ »

The Value Of Relational Databases: A Case Study

Recently asked on Yahoo! Answers:

SQL / Access query?

I have a 1-table client database which, as well as all the usual name / address info, includes client ‘visit’ fields. Each client may have between 1 and 5 visits per week (Mon to Fri) and each visit can be at a different time, duration and frequency (weekly, fortnightly or monthly) e.g.

Cust XVisit 1 Day1 Hrs1 Time1 Freq1
Visit 2Day2 Hrs2 Time2 Freq2
Visit 3Day3Hrs3 Time3 Freq3etc…

Cust YVisit 1 Day1 Hrs1 Time1 Freq1
Visit 2Day2 Hrs2 Time2 Freq2
Visit 3Day3Hrs3 Time3 Freq3etc…

I want to generate a report that shows monthly visits - but not details of weekly or fortnightly calls the same customer may have. E.g. If Cust X has 1 weekly visit on a Mon, a fortnightly visit every other week on a Wed - and a visit on the last Fri of each month, I only want to see details of the Fri/monthly visit.

Hope this makes sense!!
Any assistance very much appreciated

My initial answer to the question prompted a reply from the questioner, who noted my suggested SQL query returned all visits for the client, and who also asked about relational databases and expressed some confusion.

I’ll explain why the questioner’s current design is bad, how to make the proper relationships and demonstrate, via a downloadable copy of the improved Access database, how to best generate queries such as this user wants.

Continue reading ‘The Value Of Relational Databases: A Case Study’ »