jaeger52 Posted June 18, 2015 Posted June 18, 2015 Hello all! I've been scouring the interwebs for a whiff of anybody else who's had this problem and come up empty. Here's the deal: I wrote a simple little script that I've used for months now quite successfully, but I'm also experiencing an error where the ODBC login window will pop up, garbage text will automatically dump into the username, password, and sometimes the source fields, and then it will automatically try to log in and cause it to fail. It's intermittent, and I have no idea what's causing it. It happens in databases that I've never automated, but it does exactly what the script I wrote should do except that it's garbage text being entered. I've attached the script I mentioned. I'd appreciate anything anybody can suggest or recommend. Thanks!Send ( "{LWin}" ) Sleep ( 2000 ) Send ("Drive:\Folder\Database.accdb /x Macro") Send ( "{ENTER}" ) WinWaitActive ( "Oracle ODBC Driver Connect" ) Send ( "Username" ) Send ( "{TAB}" ) Send ( "Password" ) ControlClick ( "Oracle ODBC Driver Connect", "OK", 1 )
Moderators JLogan3o13 Posted June 18, 2015 Moderators Posted June 18, 2015 Can you explain more about what you're trying to do? Are you trying to configure a DSN? If so, you can do this without manual manipulation of the GUI. Or do you have the DSN set up and are trying to log into an application/db front end? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
jaeger52 Posted June 19, 2015 Author Posted June 19, 2015 Sure! For work I have to run a data process daily that is a 3-4 hour runtime and essential for the next day's work. We're a small team and don't have a night shift or money to hire one, so I've used AutoIt to manage the program and run it by itself at the end of the work day. AutoIt is logging into a program that allows access to external tables that are linked to the databases we're using. Most of the time it works just fine. Sometimes though, the login window fills up with garbage text, fires off and fails. What I'm trying to figure out is if this weird error is some corrupted AutoIt script running in the background somewhere, or completely unrelated to AutoIt.
Moderators JLogan3o13 Posted June 19, 2015 Moderators Posted June 19, 2015 Have you tried the AutoIt Window Info tool (in the same directory where you installed AutoIt)? If you can accurately get the Control IDs from the login window, you may be able to use the control commands to interact with the window. It may not be the end-all resolution to your issue, but would be a start, as it is more reliable than Send. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
jaeger52 Posted June 19, 2015 Author Posted June 19, 2015 I haven't tried using it for fields- but I will now. I'm going to overhaul the whole set of scripts this is part of and see if a slightly different approach will help.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now