• rewt (unregistered) in reply to J.

    No they're not. I kept a spare key in my old car so I could let it run unattended in the winter to warm up, while being able to lock the door without carrying 2 keys on me. Someone broke into the car, broke into the glovebox, saw the key and took the car.

  • rewt (unregistered) in reply to J.

    Again with the quote...

    J.:
    I keep a spare set of keys in my car??? Whats wrong with that? They are safe in there.

    No they're not. I kept a spare key in my old car so I could let it run unattended in the winter to warm up, while being able to lock the door without carrying 2 keys on me. Someone broke into the car, broke into the glovebox, saw the key and took the car.

  • rewt (unregistered) in reply to J.

    Again with the quote...

    J.:
    I keep a spare set of keys in my car??? Whats wrong with that? They are safe in there.

    No they're not. I kept a spare key in my old car so I could let it run unattended in the winter to warm up, while being able to lock the door without carrying 2 keys on me. Someone broke into the car, broke into the glovebox, saw the key and took the car.

  • (cs) in reply to QueQueg
    QueQueg:
    Not sure that this is completely WTF. I can imagine a scenario where this wouldn't be horrible, involving a 3-tier architecture where a low-access security user validates the credentials of the logging-in user, and then returns a custom connection string (that will hopefully be encrypted before transmission

    Of course its a WTF! If there is any justifiable reason for doing what he did above (note: I'm not suggesting that you explanation in any way justifies it, because it certainly doesn't), then there needs to be a good comment explaining what the hell is going on.

  • (cs) in reply to rewt
    rewt:
    Again with the quote...
    J.:
    I keep a spare set of keys in my car??? Whats wrong with that? They are safe in there.

    No they're not. I kept a spare key in my old car so I could let it run unattended in the winter to warm up, while being able to lock the door without carrying 2 keys on me. Someone broke into the car, broke into the glovebox, saw the key and took the car.

    1. "J" Was being sarcastic.
    2. You don't know how to post. (Hint: only need to post each thought one time.)
  • rewt (unregistered) in reply to savar
    savar:
    1) "J" Was being sarcastic. 2) You don't know how to post. (Hint: only need to post each thought one time.)
    1. Ok, I didn't know I couldn't reply to a sarcastic comment.
    2. I'm well aware, but forgot to quote the first time (see "Again with the quote...") and the first post with quote didn't show up, like one would typically expect, so I reposted assuming that something went wrong. I figured either way someone would have something to say - either "You only need to post once" or "Learn to quote", I chose to repost WITH the quote so people would know what I was replying to.

    <sarcasm>Sorry to have ruined your day</sarcasm>

  • (cs) in reply to James Schend
    James Schend:
    We have a database full of connection strings. It's our Admin database that consists of a list of all our clients and their projects. For each project, there's a different database (all copied from a common model DB), and the connection string points to it. It's a handy solution, and I've never thought of it as a WTF.
    Do you hardcode your connectionstrings into your queries, like these guys, instead of selecting them out of a table column?
  • will (unregistered)

    Not as dumb as it sounds, we have something similar at a place I use to work, commercial product not home grown. In addition to the database connection a bunch of other configuration information was passed back.

    It is a communication system design, full video capability, white board, VTC basicly everything communication wise under the sun , so that internal and external people can connect using a single account and allows for multiple areas. What happens is the user run the application and enter the user ID, password and name of a public database(used the free version of sql server 2000), with a config file user account/password. The software get the connection information and then disconnects and connects to that communication server and database, the database allows you to search text past communications, stored uploaded files and record videos from the various rooms.

    Where the "neat" thing comes in is that you can setup multiple servers for internal users, external user and special events, etc, users can connect with the same information but as far as the servers are concerned they can have unique really strong, unique passwords. We worked with alot of external users who connected to the external servers in addition to having their own servers, so all you had to do was use the configuration software and it would setup accounts and everything and give you out scripts that could then be sent to the remote server and run and the users would then have access to that server all using their old accounts and passwords. We would also have special events located at remote locations where they would bring a server with the accounts already setup, but they would need to configure the server for the local IP adresses,etc , once the remote server was configured they could send us the information a quick run of the configuration software and the users could start connecting.

    The real benefit was that users did not need to know where the servers were located, if the user forgot their passwords just change the one machine and they were back communicating with machines we had no easy control over and if a remote machine got stolen, who cares, even if they could decrypt the passwords in the database we had already deleted the accounts for the central machine and could of easily configured another machine with the users really not knowing much had happened.

    That is a very simplified view of what was done, a lot of other security features not mentioned along with other stuff such as cross platform support. Was it the best way of doing it? hey it was 2001 software, but even now for the easy way it worked for the users it would still be hard to beat.

  • JohnFx (unregistered) in reply to Auto Enthusiast
    Auto Enthusiast:
    J.:
    I keep a spare set of keys in my car??? Whats wrong with that? They are safe in there.
    Where do you park your car? What color is it? What's the License number?

    Wouldn't do you any good, he always locks it so no one can steal the keys.

  • JohnFx (unregistered)

    With a few caveats, I think this is perfectly acceptable: Caveat 1: It really selects data and not a literal like the probably censored example given. Caveat 2: The connection strings it selects are from a separate DB.

    Ever heard of a pointer to a pointer?

  • Hallo.Amt (unregistered) in reply to J.
    J.:
    I keep a spare set of keys in my car??? Whats wrong with that? They are safe in there.

    Happend to a teacher of mine. On his first day.

    Captcha: gotcha :-)

  • (cs) in reply to rewt
    rewt:
    Again with the quote...
    J.:
    I keep a spare set of keys in my car??? Whats wrong with that? They are safe in there.

    No they're not. I kept a spare key in my old car so I could let it run unattended in the winter to warm up, while being able to lock the door without carrying 2 keys on me. Someone broke into the car, broke into the glovebox, saw the key and took the car.

    How do you know that they saw the key and took the car? Maybe they just took the car without the key?... Can you say 'insurance fraud'? :)

  • daBowmore (unregistered) in reply to Definitely

    I don't understand. I think you must already know the connection string before you can get the connection string? We must OBEY the laws of thermodynamics.

  • (cs) in reply to JohnFx
    JohnFx:
    With a few caveats, I think this is perfectly acceptable: Caveat 1: It really selects data and not a literal like the probably censored example given.
    Why would column names and concatenation operators be censored? Blaming the anonymization only goes so far.
  • Immibis (unregistered) in reply to Auto Enthusiast
    Auto Enthusiast:
    pitchingchris:
    Auto Enthusiast:
    J.:
    I keep a spare set of keys in my car??? Whats wrong with that? They are safe in there.
    Where do you park your car? What color is it? What's the License number?

    Directions to J's car:

    Drive to New York City. Swim East 3400 miles Nearest parking lot, nearest car, plate 456-123

    I expected the plate number to be ID10T or Paula

    What if you leave BOTH sets in your car, with the windows wound up to 200% of their maximum height, and the ignition is maybe on?

  • (cs) in reply to bubba
    bubba:
    That's what scares me. Everytime a WTF is posted, there's WAY too many people trying to justify it.

    It's like when a serial killer is found and his neighbors will think about any possible explanation.

  • Steve (unregistered) in reply to UFie
    UFie:
    It's obviously intended to be used on a quantum computer.

    You select the information out of the database, and then use that information to connect to the database!

    Budyy that joke is soooooo yesterday

    September 2007!?!?? wtf how did i get here ?

  • Izzy (unregistered) in reply to FredSaw

    I knew you'd regret having a car with Windows.

  • Izzy (unregistered) in reply to FredSaw
    FredSaw:
    J.:
    I keep a spare set of keys in my car??? Whats wrong with that? They are safe in there.
    Yeah, and besides, if you've locked your keays in the ignition and it's starting to rain and all your windows are down and your seats are going to get all wet, you can reach in through the window to retrieve the spare set from the glove box.

    (Clicking stopwatch...)

    I knew you'd regret having a car with Windows.

    (second try, this time including the quote.)

  • ray (unregistered)

    it's most likely using an Access database

    you must supply a FROM clause, so just "SELECT 'blah'" wont work, hence their user of the users table.

    but yeh, they might as well just put the string into a variable

  • Eam (unregistered) in reply to will
    will:
    Not as dumb as it sounds.
    No, it's worse. Read it again, baby.

    That goes for all of you who think something is actually being read from the database here.

  • Jeff Dutky (unregistered)

    At a recent contract job I had to sit through a training session on how to use literals in C++ code. While there were a whole slew of WTFs in the training (unrelated to this discussion) this exact recommendation came up: in a discussion of where to put a specific class of literals, including connections strings, user names and passwords, one of the recommended locations was in the database. The example given in the presentation, however, showed the DATABASE NAME, USER NAME and PASSWORD being moved from source code (admittedly, not a good place to put it) INTO THE DATABASE! The presenter did not seem at all amused when I pointed out the difficulty involved in this example.

  • DavidTC (unregistered) in reply to poochner
    poochner:
    That does beat the climactic scenario of gathering the suspects together and the protagonist reaching out of the open window and grabbing a completely new character who is then revealed to be the true villain. Based of course on information in a safety deposit box that was never mentioned previously in the text. I never read another one of that series of books after that.
    Speaking of that, I was flipping through the channels and saw the traditionally 'unmasking' scene in one of the new Scooby Doo cartoons the other day. They had caught the monster and unmasked the villain to reveal...someone they'd apparently never seen before. Velma said something like "Wait a minute, I have no idea who this is, I've never seen them before! This isn't fair! This doesn't count!" and someone else had to explain who she was.

    I was laughing the rest of the day. I didn't see the rest of the cartoon, so I don't know if we knew about the villain or not, but it is a pretty silly conceit in the first place that to solve a mystery you get presented with five different characters and it's always one of them.

  • gygax (unregistered) in reply to merreborn
    merreborn:
    J.:
    I keep a spare set of keys in my car??? Whats wrong with that? They are safe in there.

    In all seriousness, a friend was at a wedding about 200 miles from home, and broke his car key off in a cork, trying to open a wine bottle.

    He called a tow-truck operator who came out and jimmied his door open, then he used the spare he kept in the car to get home. If it wasn't for that spare, he'd have been stranded a long way from home...

    Then he should learn how to hotwire cars. ;) And to use cork screws.

  • Tom Melly (unregistered)

    I'm really confused - what column is being selected here?

    It looks like the sql is selecting a column called:

    "driver={SQL Server};user id=<removed>;pwd=<removed>; Network=dbms;server=127.0.0.1;database=<removed>;"

    and returning all values from that column as "dbconn". This goes way beyond a coding wtf...

    I'm no sql expert, so what am I missing here?

    I mean, something like: "select ConnectDetail from Connections where UserID = <removed> as dbconn" would make some sort of sense...

  • nomdeplume (unregistered) in reply to Tom Melly
    Tom Melly:
    I'm really confused - what column is being selected here?
    That's the point, there is no column. It's selecting a string literal.

    SELECT 'Hello'

    will cause the server to return to you a one-row result set consisting of one column, with the string value 'Hello'.

    It's difficult to come up with a rational explanation for this, although some of the WTFers have had a decent try.

  • Tom Melly (unregistered) in reply to nomdeplume

    Phew... which just begs the questions:

    1. Why, on God's earth, would any one ever need to do that with SQL? (select a literal value in your code as though it came from a database). Isn't that a WTF of its very own?

    2. Why would they do that here? (ignoring the obvious answer "because if they hadn't done it, it wouldn't be on TDWTF and therefore you couldn't ask the question"). I mean, why not just say "dbconn = <this> + <that> + <whatever>". How does someone rationally decide to take that approach? Do they fly from England to France via Hong Kong?

  • (cs) in reply to DavidTC
    DavidTC:
    it is a pretty silly conceit in the first place that to solve a mystery you get presented with five different characters and it's always one of them.
    There is an ideal upheld by many mystery writers to make it a "fair" mystery - to provide exactly enough information for a clever enough reader to be able to solve it and be absolutely sure of the solution before the reveal. This comes from this being the way many people enjoy mystery novels, i.e. to work it out themselves (and thus, it'd suck for it to be _impossible_ for them to work out themselves) rather than simply passively absorb the words on the page.
  • rewt (unregistered) in reply to wonkoTheSane
    wonkoTheSane:
    rewt:
    Again with the quote...
    J.:
    I keep a spare set of keys in my car??? Whats wrong with that? They are safe in there.

    No they're not. I kept a spare key in my old car so I could let it run unattended in the winter to warm up, while being able to lock the door without carrying 2 keys on me. Someone broke into the car, broke into the glovebox, saw the key and took the car.

    How do you know that they saw the key and took the car? Maybe they just took the car without the key?... Can you say 'insurance fraud'? :)

    When the car was recovered a few weeks later, the key was in the ignition and the ignition wasn't tampered with.

  • Rich (unregistered) in reply to J.
    J.:
    I keep a spare set of keys in my car??? Whats wrong with that? They are safe in there.

    I do keep a spare key in my car. That way I can keep my non-waterproof remote key and large selection of other keys in the car whilst I take my nice slim, waterproof non-remote car key swimming.

    Rich

  • nome (unregistered) in reply to merreborn

    I keep a spare too hidden somewhere inside the car.

    If you are in a place and time where waiting for a tow-truck (or anybody, really) for help is not the smart thing to do, you can always break a window and use the key to escape.

    A side window is cheap, less than $100 or so if you install it yourself. Your health or life is not.

  • Naveed Siddiqui (unregistered) in reply to Laura

    Its more like keeping the keys of your locker in another locker. So nothing wrong with that i think

  • noel (unregistered)

    I see nothing wrong with pulling the connection string for one DB from another DB. It is actually an elegant solution to implement single-sign-on across different platforms and legacy systems.

  • V (unregistered)

    OMFG this must have come from Microsoft Commerce Server. Worst fucking piece of GAH ... grumble

  • eric bloedow (unregistered)

    reminds me of a book, where someone tried to send an encrypted message using the message ITSELF as the code key...which would make it impossible to decode, because you would need to know exactly what the message said in order to decode it...

  • 🤷 (unregistered)

    I used to work with an application that would do (some) logging in the database. Including an error message when the database wasn't available. Strangely enough, I didn't found a single "Database not found!" log in the logging table...

Leave a comment on “SELECT [Connection_String] FROM [WTF]”

Log In or post as a guest

Replying to comment #:

« Return to Article