• 1 (unregistered)

    SendKeys "FRIST", True

  • someone (unregistered)

    Seem to be a lot of articles of people's own WTFs with no foreseeable alternative, rather than other people being TRWTF. I guess one could say that the environment that causes these snippets is TRWTF, but still...

  • Quite (unregistered)

    Everybody knows that what you do here is that you while-loop round testing to see if the resource is available. I can't remember the last time I saw the "wait one second and hope for the best" technique ever ending well.

  • Rick (unregistered)

    Seems to me the real WTF here is the requirement to programmatically convert a linked table to a local one? Surely that would only be a one-off task, in which case you should just do it manually that one time? If you're using linked tables, they're linked to a server somewhere (probably SQL Server), and you know their structure and relationships. Just recreate them in a local Access database and transfer the data. If you've spent a week on this task you're doing it wrong.

  • derpface (unregistered) in reply to Rick

    You have not had the true horror that is Access inflicted upon your psyche I see.

    Each separate install of the "application" needs to pull the database data from the source, and it may well be some horrific sodomite of an application that creates tables according to user input dynamically. I wouldn't put it past something created in Access.

  • jgh (unregistered)

    Yea gods, I remember when I first encountered Visual Something back in 1990-ish the manual explicity stated that the sole way of doing many things was to send keypresses to other applications.

  • Nate Hoffelder (unregistered)

    I don't see the problem. In fact, I think unies should teach a programming class focused on MS Office.

  • Dave (unregistered)

    This is absurd. At the very least you could check if you have focus on Access before entering the important keystrokes.

  • Ronan (unregistered)

    And people hate php?

  • Unregistered (unregistered) in reply to Ronan

    It's possible to hate Access and PHP.

  • Appalled (unregistered)

    So Silly. The guy had NO CLUE how to program in VBA. Nor did he care to Google/Learn. He recorded a Macro/KeyStrokes, then lifted that out of Macros and placed it into a VBA module inside a loop (at least he learned THAT much). The proper way would be to learn the VBA Language and figure out how to run a simple "Make Table" query (which is all that "ConVert to Local Table") does. There are so many ways to do so that there's no point in listing them. But the final simple result would be a VBA Module that executes the the query "Select * FROM LinkedTableXXX INTO LocalTableXXX". Done. But he probably wants to set the names as well so add in DoCmd.Rename "LinkedTableXXXBackup", acTable, "LinkedTableXXX" and DoCmd.Rename "LinkedTableXXX", acTable, "LocalTableXXX". (Yes the MS Access rename command is ass backwards, Rename(NewName,Type,CurrentName).

  • The incredible Holk (unregistered) in reply to Ronan

    There is enough hate in the world for both.

  • Anon (unregistered)

    "For some reason...Microsoft...decided it wasn't being used"

    That's why you need to ENABLE telemetry in your Microsoft apps.

    If you provide zero feedback indicating a feature is used, the developer no longer has any reason to continue spending money on maintaining it.

  • Andreas (google) in reply to Quite

    AFAIK you can't check from inside VBA if the context menu is available.

  • name (unregistered) in reply to Anon

    that's why you DISABLE telemetry in your Microsoft apps. If you provide zero feedback they will hopefully stop developing/selling Access

  • TheCPUWizard (unregistered)

    As someone who has (off and on) been creating applications since Access 2.0 [1993], it can be a horror, but it does not need to be [like so many things].

    The limitation with many of the suggestions is that "Make Table" and others do not deal with the key part" of Keep Relationships intact, that is typically the challenge with coming up with a VBA solution (it is tedious, but perhaps a days work if you have to start from scratch).

    100% agreement on Telemetry. If you don't enable it ("Do you want to be part of the Customer Improvement Experience?") then you forfeit all right to complain about features being dropped. Microsoft does use this telemetry to influence product directions.

  • Cornify (unregistered)

    SendKeys "r", True SendKeys "e", True SendKeys "a", True SendKeys "l", True

  • Klimax (unregistered) in reply to name

    Not happening. (And your suggestion is idiotic and lacking any logic or thought - "absence of evidence is not evidence of absence") And not every use of Access is WTF.

  • Gidds (unregistered)

    I'm lucky enough not to know any Access, or whether there's a better approach.

    But if you're going to do a ghastly hack, this is the right way to do it: explain exactly what you're trying to do, why you're having to do it this way, and why any other seemingly-obvious solutions won't work here; and wrap it up neatly so that you (or any poor sod coming after you) can easily replace it with a better solution if one's found.

    (Actually, that's good advice when doing /anything/ non-obvious or complicated...)

    So this looks like it'd fall into the category of ‘something bad, done well’.

  • Access Developer (unregistered) in reply to Appalled

    Clicked in to look for this comment. A voice of reason, someone who's thought about the problem for 10 seconds, instead of another jump-on-the-access-hate-bandwagon circle-jerk reply.

  • Appalled (unregistered) in reply to Access Developer

    Thank you. It is rare and greatly appreciated when I get an "up-vote" rather than crapped upon by the nut-jobs in this forum.

    For Example, TheCPUWizard just HAD to chime in with a meaningless tidbit.

    It goes without saying that sucking in local copies of another app's (might even be SQL Server or MySQL) linked tables will NOT get any database Relationships. So why bother saying it and prefacing it with "many of the suggestions" when I was the ONLY one? Does anyone even wonder why?

    Hey CPU, wiz on this: I've been developing IT applications in EVERYTHING since 1976 and have forgotten more than you've ever learned.

  • LeaveItAndWeep (unregistered) in reply to Appalled

    My friend, You may have been honing your programming skills since 1976, but it's quite clear from the way you talk to fellow programmers that you haven't even started developing your social skills. I'd suggest you work on that, because spoiler alert: your social skills are not that good.

    And if you're looking for a pun, here it is: I'm appalled by your lack of kindness!

  • AC (unregistered)

    Obviously never heard of Docmd.TransferDatabase().

  • Appalled (unregistered) in reply to LeaveItAndWeep

    Bite it CPUWizard. Yes we know it's you from the grammar and conceit. You're an Axxhole and more will stand by me than by you.

    I'm greatly appreciated for my lack of kindness in dealing with POC's like you.

  • Alex (unregistered)

    At the risk of being somewhat useful to our poster, using UIA or similar accessibility techonolgies would be "better" than SendKeys. Where better here means that instead of summoning Cthulhu your code will only cause a plague of snakes (YMMV).

  • The true WTF? (unregistered)

    I don't know which is worse: the complete ignorance of the MS Access application API,

    ...or the comments suggesting that Print Preview (+F10 v) is some sort of data import.

  • Lol at the circle-jerkers (unregistered)

    Appalled is right, this is trivial to do in Access but it is amusing to watch the usual dickwads and their "hurr derr Access sucks" wankery.

    I'm glad it happens though, I make a good living from getting Access to do something (usually trivial) that the incumbent tosser said was impossible.

    The biggest dickhead is whoever wrote that code, and second being the fool who published it (but that's normal). The only real reason you'd convert a linked table to local is to cache static data locally, which can speed up performance (but usually doesn't). And in that case the conversion would be a one-off and you merely copy data across.

    He's probably copying over some stats, eg "Sales_Data_2017_June" and then running reports on it, since his code is shit his data structure is going to worse. Needs to be local because his network is crap too.

  • Haggishunter (unregistered) in reply to TheCPUWizard

    "Microsoft does use [a form of customer feedback] to influence product directions."

    Well that's my ghast flabbered.

  • MiserableOldGit (unregistered) in reply to Lol at the circle-jerkers

    Yes, I do suspect the real WTF is whatever crappy architectural decisions have lead to the requirement, not least, why shift to 2016 if it drops a key bit of functionality?

    Others have highlighted better ways exist to do this, the relationships issue (which is not to do with relationships in the source DB, but any you may have created locally to the linked table) is also fixable, if a bit of faffing about.

    All in all the biggest WTF is two people attempting to justify this bit of crap to write a TDWTF article.

  • Friendly_Reminder (unregistered)

    "It's a Doctor Who reference, since by the time this runs, we'll know who the next Doctor is, and no matter WHAT happens, the Internet is going to implode until there's an event horizon from which not even the TARDIS could escape."

    Lol, so true. "#NotMyDoctor"!!! I think every new Doctor has created a shitstorm in the fanbase, since Hartnell. And now it's going to be a female Doctor. WHAT WHERE THEY THINKING?!!!! Some people's heads already exploded when the mere possibility was stated that the next Doctor might be female, leading to such hilarious comments at the Daily Mail website like "Nobody wants a TARDIS full of Bras" (which would make for a pretty good episode title) or "Time travel is for men and men only", or "they are indoctrinating our children" or "political correctness should not exist in space". Makes you think if those retards have ever watched a single episode of DW. He's space's biggest SJW!

    That being said, no Doctor could possibly ever be better than Matt Smith. End of story.

  • Shellacked (unregistered)

    I love all the Blakey alts going on about doing it wrong, as though there's not two decades worth of bad advice from Microsoft and other questionable experts. Even PHP has a better ratio of good documentation.

    MiserableOldGit gets this right - when you get stuck with a WTF like this, it's often due to organizational stupidity: if $COMPANY gave you permissions to do things The Right Way(TM), they might know enough to trust you with a real database.

    The one good use I've found for Access is as a hopefully transitional step up from the business critical 30MB Excel macro monstrosity on the network share that 12 people need to use at once.

  • Lol at the circle-jerkers (unregistered) in reply to MiserableOldGit

    Recreating relationships in Access is easy, I've got code that does that.

    You can do it in VBA fiddling with the table object if you insist, but as Access does SQL then just generate & run a query.

    Stupid developer, stupid poster, even stupider commenters. Just another day on WTF.

  • V (unregistered)

    Just FYI, Access rocks. Back in the day it helped me learn SQL by just fooling around out of curiosity, without ever reading a book about it. And that's just from its visual query builder UI, a tiny fraction of the goodies it provides. It was an unparalleled piece of software, had no decent OpenOffice alternative for forever. I don't even know if it has one nowadays.

    Anyone bashing it is The Real WTF.

  • Ulysses (unregistered) in reply to LeaveItAndWeep

    Hmm, 'honing' isn't the word that comes to mind.

  • Guest (unregistered)

    This has to be the first WTF that has helpful comments in it. I enjoyed the comments from start to finish.

  • DarrickPiero (unregistered)

    Hello Guys, Glad to Join! :)

Leave a comment on “Impersonated Programming”

Log In or post as a guest

Replying to comment #481718:

« Return to Article