Wednesday, September 27, 2006

How to generate a connection string

1 The other day I found myself trying to write my own connection string to a System DSN I had just set up. That was stupid and silly and I know that now. Seriously, who remembers the syntax for creating a connection string? No one. Why? Because we don't need to create these things every day. And also, it is stupid and silly.

So I donned the ceremonial robe and beseeched the great google for help. Of course, I was presented with a mountain of information on connection strings. But then it pulled out a large chest that looked like something right out of a pirate movie. I think this was because it happened to be International Talk Like a Pirate Day. The great google loves this stuff.

It spoke these words to me, "Avast! These examples be good, but ye have the noggin of a bilge rat. Perhaps ye be in need of some voodoo, ...some Windows voodoo." And it pulled a scroll from the chest and handed it to me with a twisted ferret look in its eyes.

Hmmm... voodoo, eh? Sounds iffy. But then again, not all windows voodoo is bad. There have been books dedicated to the subject. And I think we have all been in situations where we would gladly rub our computer monitors down with a fried drumstick from KFC while chanting the names of the 12 dwarves in reverse alphabetical order, if it would just keep IE from spewing random "Operation aborted" errors at our users. But that is another blog post. I wasn't that desperate, yet. I opened up the scroll, read the instructions and said to the great google, "This may be the grog talking, but I like sheh way you sthink." What follows are simple steps to get windows to generate a connection string that even a bilge rat could perform after a couple mugs of grog.

  1. Create a new file, the name doesn't matter, and give it a .udl extension.
  2. Double click on your new file. This will bring up the Data Link Properties dialog
  3. Select the "Use connection string" option and then click the "Build..." button.
  4. Your connection string will show up in the connection string text field. You can also access it by opening up your udl file in a text editor.

No comments: