March 08, 2007


My DST for R5 fix
Posted by Jess in Tech Talk

I know it's late in the game, but sometimes acts of desperation lead to the best creativity. At least that's what I'll keep telling myself!

We all know the dilemma for R5 users (and yes, there are still R5 users out there). According to IBM's technotes, there is no timezone information stored in the fields on the calendar documents themselves, so there is no way to differentiate documents created BEFORE the system was patched vs. AFTER.

Well, I think there is.

I just gave up my computer repair business of four years, however, it seems to have it's advantages sometimes. Those Microsoft patches are durn tricky sometimes. In fact, sometimes you have to outright remove it manually, including all traces that it was ever installed (so you can reinstall it!).

It's those traces that are what interests me. All Microsoft updates have "KB" numbers. If you want to know what they are, you can go to Add/Remove Programs and click on the "Show updates" check box at the top. They'll all show up in the list. You can then cross-reference it to the technote on Microsoft's site, and it will tell you what it changed.

Whenever it installs an update, it puts a log file in your root Windows directory, such as "KB931836.log", which just happens to be the DST update patch for Windows XP. (Of course, I'm not sure about other Operating Systems, but you could look those KBs up if you had to.)

So, what does that tell us? When the log file was created, the patch was installed. If there's no log file present, the user is probably not patched at all!

For my R5 users, because time is so short, I simply created a view for them with all their appointments that fall between March 11-April 1, and October 20-November 4. (I TRIED so hard to get repeating appointments in the view, but gave up after too many hours spent on it to mention. So buyer beware, repeating meetings will NOT show up in the view below)

I then created an action button in the view for users to click on. They select a document in the view (one of the docs that falls in the extra weeks), and click the button. The button will tell them whether the calendar entry was created PRE operating system patch or POST update, and to update (or not) accordingly. It will even tell them if they don't appear to have the OS update at all.

Because time was short, I did it this way and made it so the users have to change the time back one hour themselves. If you like, you can easily transfer this code to be an agent that automatically will update only the affected documents. Of course, remember that it has to run client-side, as this is purely a relationship between the documents and a single computer! But we work with what we have. :-)

Enough talking, on with the code!
To make a short story long, the code checks the creation date of the calendar entry against the install date of the patch.

Oh, by the way - MANY thanks to Susan, our lovely NotesGoddess for taking the time out to help me with my R5 questions.

View Selection:

SELECT (Form = "Appointment":"Notice" | @AllDescendants) & ((STARTDATETIME >= [03/11/2007] & STARTDATETIME <= [04/01/2007])) | ((STARTDATETIME >= [10/20/2007] & STARTDATETIME <= [11/04/2007]))

Action Button Code:

Sub Click(Source As Button)
'Declarations
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument

Dim session As New NotesSession
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
For i = 1 To collection.Count
Set doc = collection.GetNthDocument( i )

If Cdat(doc.Created) <= CDat(ReturnDateOfPatch) Then
Msgbox "This document was created BEFORE your operating system was patched. " + Chr$(10) + "Confirm this appointment, you may have to move it up an hour!"
Else
Msgbox "This document was created AFTER your operating system was patched. " + Chr$(10) + "Confirm this appointment, but it's probably correct!"
End If
Next
End Sub


******
Function ReturnDateOfPatch As String

On Error Goto Handler

Dim fileName As String, fileNum As Integer
fileNum% = Freefile()
fileName$ = "C:\Windows\KB931836.log"
Open fileName$ For Input As fileNum%
Close fileNum%

ReturnDateOfPatch = Filedatetime(fileName$)

Exit Function

Handler:
Msgbox "Your operating system does not appear to have the necessary update needed to accomodate DST. Please use Microsoft Update to get the required updates!"
Exit Function
End Function


Permalink

Comments

Testing, someone said they got errors trying to comment.

Posted by: Jess at March 10, 2007 11:23 AM


c++
forums
lotus notes
misc & links
picture gallery
internet how-to articles


about jess

ICQ 822906
AIM kendrtaunt
YIM kender_taunt

xmlbutton.gif