A few thoughts at 3 a.m.

February 6th, 2010

I’m plowing my way through writing the next chapter of the Microsoft Access for Beginners series and have the insomnia to show for it.  This chapter, an introduction to Visual Basic for Applications, is one I’ve been wanting to do for awhile and should have done a long time ago but always found a way to put off.  Writing chapters on the basics of forms and reports was easy compared to introducing the reader to a programming language with an entirely different environment from Access, an event-driven paradigm, variables, decision loops and all the other fun stuff that does questionable things to a person’s brain over years of exposure.

The other chapters have been rather large for web articles and the subject of this one is so much more complex that I’ve broken it up into sections to avoid sending the readers into shock.  So far, the sections are lining up like this -

  1. Introduction – An explanation of the purpose of VBA and event-driven programming.
  2. Environment – An explanation of the programming environment and its elements.
  3. Procedures – Methods, functions and custom properties.
  4. Variables – Declaring and using variables to hold values for use in the program.
  5. Operators – Symbols used to carry out mathematical, comparison and other operations in VBA.
  6. DoCmd – I felt the DoCmd object which provides a variety of shortcut methods deserved its own section.
  7. Control Statements (multiple sections) – Decision loops and structures including IF…THEN, SELECT CASE and WHILE … LOOP.
  8. Algorithms – Once the syntax is understood, it’s time to learn how to design an actual procedure.  Determining the path for getting the right results.

That’s not the end of it but after the section on algorithms, I’ll put it all together and consider Version 1.0 of the series ready for upload.  Otherwise, it might take another few years.  Future (near future, I promise) sections will include material on:

  • Classes / Object-Oriented Programming
  • Best Practices including commenting and error handling
  • Debugging
  • Getting Help

So, why am I doing this?  All this work for a series of tutorials on a relatively obscure personal website?  There’s probably a touch of OCD involved but it also has to do with the e-mails I’ve been grateful to receive over the years from people who’ve benefited from the series.  I hope I’ve helped save some data along the way.  It also keeps my brain active, my skills sharp, my credentials as a writer somewhat defensible and my resume polished.  In the end, I figure everybody wins …

… or at least nobody gets hurt.

Stay tuned …

PDFCreator

February 3rd, 2010

PDFCreator is an free tool from PDFForge.org for creating PDF files from Windows applications. The installation adds a printer to windows which accepts the output from Word and other programs and outputs PDF files. It has a great autosave feature which will automatically save the files to the folder of your choice with a datestamp filename so you don’t have to name every one if you’re doing a lot of printing.

You can find the program and more details at http://www.pdfforge.org/products/pdfcreator.

Understanding SQL

February 3rd, 2010

(Recovered post)

I’m trying to add some new articles to the site and finish out the Microsoft Access for Beginners series while gradually writing about more advanced topics. Microsoft Access is fun but it takes more than Access to make a programmer.

One good example is Structured Query Language (SQL), the scripting language that Access and other databases use to read and manipulate data from the database. It’s easy to rely on the Query Builder interface in Access and equivalent interfaces in other database systems to do the work but until you learn how to read and write SQL on your own, you won’t truly understand how databases work. Besides, it’s pretty much expected if you want to get any kind of a real job working with databases and it really isn’t that hard.

I’ve written two short articles on SQL Basics and Modifying Data with SQL that should give you a good start in understanding this simple English-like language. I’ve also included links to more information on Microsoft Office Online and other places.

As always, comments are welcome.

Just had to step out for awhile …

February 2nd, 2010

There was a bit of an oversight while transferring the site to a new hosting service and the blog went away for awhile but it’s back now and hopefully I’ll be able to keep it up a little more than I did before.

As I said, Drewslair.com was transferred to a new hosting service during January.  The previous host, ICDSoft, is excellent and I recommend them highly having been with them for five years.  The only thing they didn’t have was support for ASP.Net which I wanted to start using with the site.  So I did a little research and switched to 3Essentials which has also provided excellent service so far. 

Another benefit of the new service is that I’m able to maintain two websites instead of one on the account so I decided to use the AndrewComeau domains for the new version of the site which I converted out of Microsoft Frontpage and into Visual Studio 2005.  This new site has pages with the *.aspx extension so Drewslair.com is maintaining the old pages and, thus, the current Google links to all the current articles.  I’m not sure yet how the two sites will ultimately diverge.  I just know there will be a lot of writing involved.

You can read more details on my work with ASP.NET on the site at:  http://www.andrewcomeau.com/desk/programming/aspnet.aspx .

Design Abstractions

May 21st, 2008

(The following is a May 2008 post I’ve recovered from from a previous incarnation of the blog)

A few years ago, Joel Spolsky wrote a wonderful article for his site called The Law of Leaky Abstractions, the general idea of which was that while new technologies such as programming tools that let you build data interfaces by clicking and draging controls might make things easier for the average professional, they will never replace a solid understanding of the technologies they are built on top of. This is because the tools that do so much work behind the scenes never offer the fine control that the lower level tools will. They also provide an illusion of power that makes it easy to avoid learning the real substance. The article provided some good examples and now I have one of my own to share.

When I started working on the site back in 2000, one of the first things I did was to figure out what software I would use. I’d used Adobe PageMill on an earlier website attempt but that was no longer available and Microsoft FrontPage seemed to offer everything I needed for the right price. I came up with a theme for the site, put together some content and was pretty happy with myself for building a site and registering a domain name to go with it without having to do any of that tedious stuff like learning HTML. This would seem kind of surprising for a programmer like me but that’s the way it was. I just wanted to focus on the content and look and feel of the site and besides, I was busy with Access at the time.

It wasn’t until a friend of mine started designing a site of his own and went straight to manually coding the pages that I was more or less shamed into learning the basics of HTML. Even then, after I realized how simple it was and how I could have some finer control when I needed it, I was just as happy to keep using the code generation features in FrontPage.

Now, aside from the way FrontPage writes its own, rather verbose, HTML behind the visual designer interface, there’s another aspect to the abstraction. FrontPage also offers features that would often be done with other scripting tools like PHP and ASP. Instead of using these scripting options, FrontPage uses its own proprietary code. I have my theories about the reasons for this but what it means to the user is that in exchange for the ease of setting up something like a hit counter or dynamic navigation, the pages need to be published on a web server that has the FrontPage Extensions installed which will translate that proprietary code and display it as intended. That was fine with me as it wasn’t too hard to find hosting services that provided FrontPage support.

Then, last year, came the announcement: Now that FrontPage was no longer available, Microsoft had dropped support for the FrontPage extensions on Linux servers which meant there would be no more bug fixes or security upgrades. My hosting service has decided to keep supporting them but will drop them if there are any security problems. That’s pretty nice of them, actually.

So, I finally decided to get off the FrontPage fixation which meant getting back into HTML and figuring out how to do on my own all the things that FrontPage does for me now. I talked to a co-worker who has his own pretty impressive site and he talked about languages like PHP and JavaScript so I figured I’d be looking at those and other options.

I checked out a couple other page and site generation packages and wasn’t really impressed. The best one I found turned out to be buggy and I didn’t want to deal with that. Then there was the issue that I’d already paid for FrontPage so I started to look through it to see how I could use it without using features that would require the extensions. I was pleasantly surprised to find it has some nice features that speed things up once you’re ready to move to the next level of web development and actually do some of the coding yourself.

I won’t be able to use HTTP to upload the site without the extensions which means that I can’t just point FrontPage to www.drewslair.com and let it sort everything out. FrontPage does upload through FTP, though, and does a decent job of synchronizing the files. My hosting service provides a good control panel interface and I was able to setup a subdomain for testing and an FTP account that would point there so FrontPage could still handle things. The borders that are shared by all the pages and include navigation and the credits are also things that I’ll have to do on my own. FrontPage also made it pretty easy to manage the theme for the site but when I look at how it does it, it’s really just a jazzed-up version of cascading style sheets so, given some time, I can do that on my own.

There are other features that I’m not sure how I’ll do on my own yet but I’m sure I’ll find something. It will be a lot of work and take some time since it’s not the only thing I’m doing right now but in the end, the site will be better for it and I’ll be a bit smarter as a site owner.