Spring Cleaning
Well it's been a hectic month, what with web sites to build and programs to write, along comes the first signs of spring. What are these first signs? The snowdrops pushing up through the soil? The birds flying around and looking into the nesting boxes trying to find a likely site to raise their offspring? Well no, the signs of spring we are referring to is the desire to make sense of the machine room, and tidy things up a bit.
With so many computers around the room a big problem is always one of where do you put all those monitors, keyboards and mice that are attached to them? Computers are no problem, they can go on the floor, up in a corner somewhere, but the other bits? They all demand the valuable real estate of your desks. Should you grant them this space they reward you by quietly tangling their leads in such a fashion that only a team of hyperactive boy scouts would have even a remote chance of untangling them.
The answer to this mess is to use a switch box which would enable one monitor, keyboard and mouse to be shared between several computers. These devices have been around for some time but have had their problems, either requiring software to be installed on the machines for switching, or the machines complaining that keyboards and mice are missing, and the maximum screen resolutions that could be used were limited. However MasterView have just release a new product called the CS-138D (catchy name that!) which seems to be just the job. This switching box uses standard rather that propriortry leads to connect to the machines, and allows switching between computer either from it's front panel or via the keyboard with just a double press of the ctrl button. It has software built into the box and requires nothing to run on the machines. We have it installed, switching between PC's running Win 98, NT4, and Linux all at different screen resolutions, and every thing works well. The CS-138D box that we are running will switch between 8 computers and comes in a rack-mountable box, these switches can be stacked so that over 300 machines can be controledcontrolled. It is incredablyincredibly satisfying to be able to remove half a dozen monitors, keyboards and mice from the office and also to be able to control all the machines from one place. If you are running any sort of office with multiple servers you should really have a look at one of these devices. MasterView's main distributor in this country is Videk (http://www.videk.co.uk). This device, and theMark has also 'shoe-horned' a full height rack cabinet that we managed towas 'shoehorned' into Mark'sinto his machine room, ready to be filled with the servers. Although at the moment isit is standing there empty, looksing more like somethingone of the monalithsmonoliths out of the film 2001.
Web on a CD
Power Menu - a great java menuing system
Another project that we have been working on is a CdCD containing documentation on finacialfinancial companies. This informanioninformation needed to be navigated easily and so we opted for an HTM version, nadand produced basically a 'web site' on a CD. Now there are a copulecouple of products out there which will do this for you, but the navigation system we chose was a javaJava applet called PowerMenu, andas we wanted it to work on as many platforms as possible. So this rulled out products like Web Compiler which requires IE4 to be installed on the client. PowerMenu (www.olivers.net) we have mentioned before in a previous article, and is an excellent, flelxible menuing system. We chose this because we wanted a menu system that could be eaislyeasily changed as the client's requirements change. Which many of you will realise is potlitepolite speech for 'the client dosn'tdoesn't know what he wants yet'! One slight problem with useingusing this control is that the syntax is a little cryptic and easy to get wrong., sTo ease thiso we wrote a little program in Access so that the menu could be designed in a table, then the code would create a text file of the html which could be cut and pasted into the page. It's a little crude but it warorks and certainly stops errors in coiding. Using databases in this way is incredablyincredibly useful. Data for html pages can be entered via forms in access and then at the 'push of a button' the new html pages with the new data can be generated. The code for this is extremlyextremely simple to do, for example:.
This is just sample code, put it on the event procedure of a button on an Access form.
Dim dbs As Object
Dim rst As Object
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("select * from menu ", dbOpenDynaset)
rst.MoveFirst
'Create and open for writing a file on the hard disc
Open "c:\menu.txt" For Output Shared As #1
Do While Not rst.EOF
Print #1, "<param name='menuItem";
If IsNull(rst.Fields("menuitemorder")) Then
Print #1, ""
Else
Print #1, Trim(Str(rst.Fields("menuitemorder")))
End If
.
.
'More code here.
.
.
Rst.movenext
loop
This will produce a text file called c:\menu.txt with lines like <param name = 'menuItem1'. The rest we'll leave up to you to have a go.
"Spam Spam Spam ....."
Using Access to sent bulk emails can be easy
Before we leave Access, there is one feature that we have used for a couple of clients this month. This is "Access the Spamming Eengine!"", now before all you raise your hands in horror, we are not condoning spamming. However both these clients had access databases with customer and prospective customer emails in them. All these emails were supplied via the user registering on thiertheir web site and so the people one these databases had requested to be sent information via email. The Clients wanted to be able to email these peopplepeople andon a regular basis about future offers and events, obviously giving people the opportunity to unsubscribe to this list. Now all this could be done with a list server, but for this simple requirement that seemed a little over the top. The data was all held in an Access table, so why not use Access to do the emailing? From pervious experience we thought that this might require some MapiMAPI programingprogramming, not too onerous but still we felt that there must be an easier way. One evening Mark was talking to a good friend, Steve who happens to work at Martlesham, for BT, about this requirement. Steve suggested some code that they had used before. Now this might take some understanding but here goes:
DoCmd.SendObject acSendNoObject, , acFormatTXT, MyRecipient, , , MySubject, MyMessage, 0
Difficult isn't it ?
The variables that you need to change are :
MyrRecipient - which is the email of who the email is going to.
MysSubject - which is the subject heading of the email
MyMmessage - whicjwhich is obviously the message body in text
The 0 and the end stops a confirmation box popping up on each email
So all you need to do is walk the table and pass the email address from tohe table to mMyrRecipient, and there you have a very flexible and powerful bulk email engine. Both the clients have tried this with mailing of over two thousand adressesaddresses and the programs are run on a regular basis, so it looks as though the code works. This example also shows the importance of always keeping an eye open foron new ways of doing tasks, and of course the importance of having good friends!
One final problem with creating this CD was that we wanted the CD to autorun and load up the default.htm page in the client's default browser. Now the autorun.inf file that you see on CDs does just this. But it will only work with programs and not .htm files. So a little trwaltrawl of Cix showed that there was a shareware product called Rrunfirst written by Doug Smith (dougsmith@cix.co.uk). To use this you rename the runfirst.exe to the name of the .htm file that you wish to run, in this case default.htm. So now we now have a program called default.exe. Nowext create an autorun.inf file like:
[autorun]
open=default.exe
icon=default.exe
and there you have it an auto running web on a CD. Sometimes life can seem too easy, there must be spring in the air.[autorun]
open=default.exe