Jump to content
Sign in to follow this  
jaeger52

AutoIt causing ODBC login errors?

Recommended Posts

jaeger52

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 )

 

Share this post


Link to post
Share on other sites
JLogan3o13

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?


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
jaeger52

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.

Share this post


Link to post
Share on other sites
JLogan3o13

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.


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
jaeger52

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • hugomito
      By hugomito
      Hi all,
      I hope you can help me with this. I need to connect to a Database using Cloudera ODBC Driver for Impala. I installed the driver, created a User DSN (drona2) and tested it successfully (got the message: Successfully connected to data source!) but when I try to connect to the database using a Conneciton String, it simply didn't work.
      I tried connecting to the database using the User DSN, I previously created, that has all parameters needed but got the following error:
           $ProviderDatasource = 'DSN=drona2;'
           $conn_Database = ObjCreate ("ADODB.Connection")
           $conn_Database.ConnectionString = $ProviderDatasource
           $conn_Database.Open
           ==> The requested action with this object has failed.:
           $conn_Database.Open
           $conn_Database.Open^ ERROR
      Also I tried adding all parameters to my connection string as follows but also got the same error:
           $ProviderDatasource = 'Driver=Cloudera ODBC Driver for Impala;Host=MyHost.domain.com;PORT=21050;AuthMech=3;UID=MyUserId@domain.com;PWD=MyPasswordc;Schema=default;SSL=1;AllowSelfSignedCerts=1;AllowHostNameCNMismatch=1;CheckCertRevocation=1;KrbFQDN=_HOTS;KrbServiceName=impala;ServicePrincipalCanonicalization=1'
      I hope someone has used this driver successfully before and can shed some light here.
      If you need additional information, let me know.
      Regards,
    • Skysnake
      By Skysnake
      Question
      How to detect / determine if requested ODBC driver is not available? Not installed?  Is there a specific function / error code to check for?
      I asked this on the ADO.UDF support page, but I think the issue is not limited to that UDF.  What test can be run to determine if the requested ODBC data driver is available?
      Skysnake
    • cookiemonster
      By cookiemonster
      Hi,
       
      Im about to start making an autoit script that will read the current ODBC settings, have a drop down to select a different one which would then update the ODBC in windows to use the new settings.
      Can anyone point me in the direction of how to read the ODBC 32 bit settings? are they in the registry?
    • GarnetDagger
      By GarnetDagger
      I would love to have some help or guidance 
      I am able to Query from my database but I am not able to Update or insert etc because I lack the knowledge for it
       
      this is my code for to retrieve some data from and works perfect
       
      Dim $ueberschriften = "" Dim $anzahl = 0 Dim $dsncount = 1 Global $DSN = "MTXXV5" Global $Query = "Select * from VIEWS" Func SSSQL($SSQuery) ;SuperSonicSQL     ConsoleWrite($SSQuery & @LF)     $cmboVal = ""     $adoCon = ObjCreate("ADODB.Connection")     $adoCon.Open($DSN)     $adoRs = ObjCreate("ADODB.Recordset")     $adoSQL = $SSQuery     $adoRs.CursorType = 2     $adoRs.LockType = 3     $adoRs.Open($adoSQL, $adoCon)     With $adoRs         Global $QueryAnswer = .GetRows     EndWith     Return $QueryAnswer EndFunc   ;==>SSSQL and this is my failed attempt, The Query is correct but I want to able to use it in autoit instead of have to manual update or insert into flamerobin
       
      $SS_SQL_Insert_or_Update = "INSERT INTO DETECTION (DNAME,DTYPE,WINNAME,AREA,COLOR,MOUSE) VALUES ('PopUpTradeInviteYes        s                    ','SEARCH','XXX','175,240,550,240,65,228,82,234','5062478','0') " Func SSSQLIU($SS_SQL_Insert_or_Update) ;SuperSonicSQL :P     $cmboVal = ""     $adoCon = ObjCreate("ADODB.Connection")     $adoCon.Open($DSN)     $adoRs = ObjCreate("ADODB.Record")     $adoSQL =$SS_SQL_Insert_or_Update ;~     $adoRs.CursorType = 2     $adoRs.LockType = 4     $adoRs.Open($adoSQL, $adoCon) ;~     With $adoRs ;~         Global $QueryAnswer = .GetRows ;~     EndWith ;~     Return $QueryAnswer EndFunc   ;==>SSSQL I am at a total loss and I am just trying this at random but I am also going to sleep now
      I would love to have some minor examples
      "C:\_CC_V10_DetectionTAB.au3" (174) : ==> The requested action with this object has failed.:
      $adoRs.Open($adoSQL, $adoCon)
      $adoRs^ ERROR
    • NetRanger
      By NetRanger
      Hi all! I'm trying to make unattended installation of Oracle Client with Oracle Universal Installer, but oftenly got false pushes of buttons. I mean, if the code is {TAB 3}{RIGHT 3}{TAB 4}{ENTER}, then one of the block oftenly working like +1, like {TAB 4}{RIGHT 3}{TAB 4}{ENTER}, what's I don't want to. How to avoid such behavior of AutoIt and does AutoIt have a problems with Java apps (due different windows style)? A script designed for x32 systems and it's ran on x32 systems. OS: Windows 7 (x32), 1 Gb RAM
      Run("D:\temp\setup.exe") ;welcome Sleep (8000) WinWait("Oracle Universal Installer") WinActivate("Oracle Universal Installer") WinWaitActive ("Oracle Universal Installer") Send ("{ENTER}") ;select installation type Sleep (7000) WinWait("Oracle Universal Installer") WinActivate("Oracle Universal Installer") WinWaitActive ("Oracle Universal Installer") Send ("{TAB 3}{RIGHT 3}{TAB 4}{ENTER}") ;specify home details Sleep (7000) WinWait("Oracle Universal Installer") WinActivate("Oracle Universal Installer") WinWaitActive ("Oracle Universal Installer") Send ("{TAB 3}") Send ("C:\Oracle") Send ("{TAB 5}{ENTER}") ;avaible product components Sleep (7000) WinWait("Oracle Universal Installer") WinActivate("Oracle Universal Installer") WinWaitActive ("Oracle Universal Installer") Send ("{TAB 2}{DOWN 21}{SPACE}{TAB 6}{ENTER}") ;product specific checks Sleep (5000) Switch @OSVersion Case "Win_XP" Send ("{ENTER}") Case "Win_Vista" Send ("{ENTER}") Case Else Send ("{TAB 2}{RIGHT 2}{SPACE 2}{TAB 3}") Send ("^{TAB}{TAB 3}{ENTER}") EndSwitch ;summary Sleep (5000) WinWait("Oracle Universal Installer") WinActivate("Oracle Universal Installer") WinWaitActive ("Oracle Universal Installer") Send ("{ENTER}") ;Oracle Net Configuration Assistant: Welcome Sleep (50000) WinWait("Oracle Net Configuration Assistant") WinActivate("Oracle Net Configuration Assistant") WinWaitActive ("Oracle Net Configuration Assistant") Send ("{ENTER}") ;naming methods configuration Sleep (500) WinWait("Oracle Net Configuration Assistant") WinActivate("Oracle Net Configuration Assistant") WinWaitActive ("Oracle Net Configuration Assistant") Send ("{TAB}{DOWN 4}{ENTER}{TAB 7}{ENTER}") ;net service name configuration Sleep (500) WinWait("Oracle Net Configuration Assistant") WinActivate("Oracle Net Configuration Assistant") WinWaitActive ("Oracle Net Configuration Assistant") Send ("main") Send ("{TAB 4}{ENTER}") ;net service name, select protocol Sleep (500) WinWait("Oracle Net Configuration Assistant") WinActivate("Oracle Net Configuration Assistant") WinWaitActive ("Oracle Net Configuration Assistant") Send ("{ENTER}") ;net service name, tcp/ip protocol Sleep (500) WinWait("Oracle Net Configuration Assistant") WinActivate("Oracle Net Configuration Assistant") WinWaitActive ("Oracle Net Configuration Assistant") Send ("10.7.200.107") Send ("{TAB 6}{ENTER}") ;net service name, test Sleep (500) WinWait("Oracle Net Configuration Assistant") WinActivate("Oracle Net Configuration Assistant") WinWaitActive ("Oracle Net Configuration Assistant") Send ("{ENTER}") ;net service name Sleep (500) WinWait("Oracle Net Configuration Assistant") WinActivate("Oracle Net Configuration Assistant") WinWaitActive ("Oracle Net Configuration Assistant") Send ("{ENTER}") ;another net service name? Sleep (500) WinWait("Oracle Net Configuration Assistant") WinActivate("Oracle Net Configuration Assistant") WinWaitActive ("Oracle Net Configuration Assistant") Send ("{ENTER}") ;net service name done Sleep (500) WinWait("Oracle Net Configuration Assistant") WinActivate("Oracle Net Configuration Assistant") WinWaitActive ("Oracle Net Configuration Assistant") Send ("{ENTER}") ;easy connect naming Sleep (500) WinWait("Oracle Net Configuration Assistant") WinActivate("Oracle Net Configuration Assistant") WinWaitActive ("Oracle Net Configuration Assistant") Send ("{ENTER}") ;naming methods config done Sleep (500) WinWait("Oracle Net Configuration Assistant") WinActivate("Oracle Net Configuration Assistant") WinWaitActive ("Oracle Net Configuration Assistant") Send ("{ENTER}") ;done Sleep (500) WinWait("Oracle Net Configuration Assistant") WinActivate("Oracle Net Configuration Assistant") WinWaitActive ("Oracle Net Configuration Assistant") Send ("{ENTER}") ;end of installation Sleep (1500) WinWait("Oracle Universal Installer") WinActivate("Oracle Universal Installer") WinWaitActive ("Oracle Universal Installer") Send ("{ENTER 2}") Send ("{ENTER}")  
×