Access Fear Factor III: A Picture Is Worth a Thousand Words
Last time, in Access Fear Factor II, we just finished using Word’s mail merge feature to avoid using Access’ report feature. The end result was the beautiful document shown in Figure 1. For your convenience, the top view shows the "finished" movie review document, complete with one movie showing. The bottom shows the ugly details.
Until now, I have assumed that you’ve been saving your Word document as you go along. That being the case, it exists on your hard drive. Choose File, Open, navigate to the file, and open it. You should see the rude dialog box shown in Figure 2. Let’s call this a loose end.
SQL? How in the world did that get in there?
SQL stands for structured query language. Yes, I know it’s dreadful, but we’re stuck with it. When setting up the Mail Merge, we selected an .mdb file in step 3 of 6. Previously, I didn’t mention the Confirm Data Source dialog box shown in Figure 3. When in doubt, take the default, right? Well, that’s what I did, and I assume that that’s what you did as well. That choice resulted in using an "OLE DB database". Literally, that’s object linking and embedding database database. Don’t you just love redundancy?
In any case, this ultimately uses SQL. Furthermore, the sad fact is that regardless of which of the three Access choices showing in Figure 3 we might have selected, we’d still get the same prompt shown in Figure 2. There’s no escape from SQL.
On the bright side, we don’t really need to know or care about the distinction among these choices or about the fact that SQL is being used. (The only reason why the dialog box even mentions SQL is to upset and humiliate the uninitiated.) For us, all the choices that mention Access effectively get us to the same destination. And thanks to the miracles of Microsoft, any SQL we need for this simple database is all automatic.
Another loose end I callously ignored in the previous article is the action that happens when you use Access to open the database itself. Using Access, choose File, Open, navigate to the .mdb file in question, and open it. Assuming that the Word file that uses it is still open, you’ll see the dialog box shown in Figure 4. This lets you know that you’re opening the database file for "shared access." Basically, this means you can add data from Access while Word is using the database, but you can’t modify the data structure. You’ll need to know the latter later.
Click OK, and you’re presented with the dialog box shown in Figure 5. The security warning tells you that the file might not be safe if it contains code intended to harm your computer. Getting dizzy from going in circles?
In this case, you created the file. Did you sneak in some destructive VBA code while I wasn’t watching? Me neither. Designed to increase the market for blood pressure medication (and lawyers), the warning can be ignored when you created the database and when it hasn’t been out of your custody since arriving at the airport. Needless to say, all this sarcasm should be tossed out the window if the database file was created by evildoers.