Jump to content

DBowers

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by DBowers

  1. Hi, Thanks, I have fixed that. How should I access the check boxes in the array? I am still getting the error "Subscript used with non-Array variable". Am I supposed to create a new checkbox, and set that to something inside the array? - DB
  2. Hi, I have created an array of checkboxes: CODE Global $ctl_companySelectionCheckboxes For $v_i = 1 To $v_allCompanies[0] Step 1 ; $v_allCompanies[0] contains the length of the array. _ArrayAdd($ctl_companySelectionCheckboxes, GUICtrlCreateCheckbox(GetCompanyName($v_allCompanies[$v_i]), x, y)) EndIf Next However when I tried to set their states with "GuiCtrlSetState($ctl_companySelectionCheckboxes[1], $GUI_CHECKED)", I get the following error: CODE GuiCtrlSetState($ctl_companySelectionCheckboxes[1], $GUI_CHECKED) GuiCtrlSetState($ctl_companySelectionCheckboxes^ERROR Error: Subscript used with non-Array variable. Am I not accessing those checkoxes in the right way? Please help! - DB
  3. Hi, Thanks for the quick reply. On invalid login, I got the following error: Line 130 (File "C:\test.au3"): $v_sqlConn.Open($v_sqlConnStr) $v_sqlConn.Open($v_sqlConnStr)^ERROR Error: The requested action with this object has failed. I have tried using the following block to catch the error right after $v_sqlConn.Open() but that didn't work. If @error Then MsgBox(0x40000, 'Object', 'Failed') EndIf Any suggestions? Thanks!
  4. Hi, I am using the following code block to log into a database from AutoScript: $userName = InputBox("Login prompt", "Please enter your username.", "", "", 400, 50) $password = InputBox("Login prompt", "Please enter your password.", "", "*", 400, 50) $v_sqlConn = ObjCreate("ADODB.Connection") $v_sqlRecordSet = ObjCreate("ADODB.Recordset") $v_sqlConnStr = "Provider=SQLOLEDB;Data Source=myDSr;Initial Catalog=default;User ID=DBowers;Password=BowersD;" $v_sqlConn.Open($v_sqlConnStr) $v_sqlQuery = "SELECT * FROM TBL" $v_sqlRecordSet.Open($v_sqlQuery, $v_sqlConn) How would I know whether the username/password is right, and prompt for username/passwords again until they work? Thanks!
  5. Hi, I have a script that gets executed manually, and I need to log who ran it - is there a way to find out from AutoIt? Thanks in advance.
  6. Kerros, Thank you so much! That helped a lot.
  7. Hi, I have just started to learn AutoIt scripts and I think it's an amazing tool. I have an AutoIt script that takes one input parameter (hard-coded now) and simulates keystrokes, mouseclicks etc to generate a report out of our ERP system. I will need to run this script for N times with the value of that input parameter coming from a database. Is there a way to programatically generate this AutoIt script based on my database input, and then make it an executable file? Thanks!
×
×
  • Create New...