Jump to content

suthern101

Members
  • Posts

    12
  • Joined

  • Last visited

suthern101's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Note that this simple query produces the "Operation not allowed when object is closed" error using Windows Authentication on MSSQL $sSQL = "declare @p11 varchar(255) set @p11='No Error' select @p11" But when you put SET NOCOUNT ON prior to the declare section, the query works as expected. $sSQL = "set nocount on declare @p11 varchar(255) set @p11='No Error' select @p11" Is this a bug in adodb? in _sql.au3?
  2. I've got a curious problem: (solved: see bottom of post) When I run SQL which calls a stored function, I get "This operation is not allowed when the object is closed" But when I copy that exact same SQL to the clipboard and run it on SQL server, I get a result without any problem. I can also change the SQL code to something much simpler, and the error vanishes. $sSQL = " declare @result int, @p11 varchar(255) " & @CRLF & _ " set @p11='No Error' " & @CRLF & _ " exec @result = uspWFInitializeChecklist @Company=" & $iCo & "," & _ "@Template='" & $v_template & "'," & _ "@SourceType='" & $sourcetype & "'," & _ "@Status=" & $status & "," & _ "@Name='" & $v_name & "'," & _ "@EnforceOrder='" & $enforceorder & "'," & _ "@UseEmail='" & $useemail & "'," & _ "@IsPrivate='" & $isprivate & "'," & _ "@AssignedTo='" & $v_username & "'," & _ "@Level=" & $v_level & "," & _ "@DueDate='" & $v_date & "'," & _ "@DueTime='" & $v_time & "'," & _ "@SendNotification='" & $sendnotification & "',@msg=@p11 output " & @CRLF & _ "select @result Result, @p11 Message" ;$sSQL = 'Select TOP 5 * from bJCCD with(nolock)' ; this works without a problem Local $iRows ;Number of rows Local $iColumns ;Number of columns Local $aResult SQL_Connect() ClipPut ( $sSQL ) ;if _SQL_GetTable2D(-1, $sSQL, $aResult, $iRows, $iColumns) = $SQL_ERROR Then if _SQL_QuerySingleRow(-1, $sSQL, $aResult) = $SQL_ERROR Then Msgbox(0 + 16 +262144,"Error","SQL Error: " & $SQLErr & _SQL_GetErrMsg() ) Else _ArrayDisplay($aResult) EndIf _SQL_Close() Does anyone have any idea why? The result when run on the server itself displays in one row with two columns. No errors. Things I've tried: Searching google (and these forums) Closing the connection at the end of the first query (in GetVPChecklists), then opening it again right before we attempt to run the more difficult stored procedure This error happens in _sql.au3 at line 467 when $objquery.eof is checked to see if there is any data. This is immediatly after _SQL_Execute was called which did not return an error. I've been scratching my head for a couple of days now, and would appriciate any pointers. Thanks! Edit: This code $sSQL = " declare @p11 varchar(255) set @p11='No Error' select @p11 " also pops up the same "operation not allowed" error. Edit: Solution!! Putting SET NOCOUNT ON at the beginning of my query solved the problem. Perhaps someone else will find this post while looking for a solution. My full query now looks like this: $sSQL = "SET NOCOUNT ON declare @result int, @p11 varchar(255) " & @CRLF & _ " set @p11='No Error' " & @CRLF & _ " exec @result = uspWFInitializeChecklist @Company=" & $iCo & "," & _ "@Template='" & $v_template & "'," & _ "@SourceType='" & $sourcetype & "'," & _ "@Status=" & $status & "," & _ "@Name='" & $v_name & "'," & _ "@EnforceOrder='" & $enforceorder & "'," & _ "@UseEmail='" & $useemail & "'," & _ "@IsPrivate='" & $isprivate & "'," & _ "@AssignedTo='" & $v_username & "'," & _ "@Level=" & $v_level & "," & _ "@DueDate='" & $v_date & "'," & _ "@DueTime='" & $v_time & "'," & _ "@SendNotification='" & $sendnotification & "',@msg=@p11 output " & @CRLF & _ "select @result Result, @p11 Message"
  3. I realize this is an old topic, but the issue still plagues us today. I have an auto-it created GUI which I want to stay in-position with a parent window. This parent window is NOT created by Autoit. Right now I use a loop every 500ms to check the location on the parent window and then update the autoit GUI to match, but that seems a bit silly if windows can already do that. When I run the above code (that Squirrely1) posted, the 'Child GUI' only stays open for as long as the sleep function (on line 27), then the child GUI vanishes. The script is still running, but 'Child GUI' is invisible. I've tried putting 'GuiSetState(@SW_SHOW,$child_Toolbar)' in the loop, before the loop, but to no avail. The 'Child GUI' is just plain invisible. Not only invisible, but gone. WinExists reports it as not existing. So, why does the DLL call make the child vanish? I'm on XP SP3, if that helps. Does anyone else have this issue?
  4. Using HTML it is possible to disable certain lines in the combo box on the web. This makes showing trees like Root Branch_#_1 -leaf -leaf -leaf Branch_#_2 -leaf -leaf possible, and only allowing the user to select the leafs. Are we to believe that a browser can create a control on a webpage better than AutoIt? Creating 'unselectable' lines really helps with the organization of long combo lists. Perhaps AutoIt v4 will have this.
  5. Yes, the black flashing window is caused by the ShellExecuteWait call on line 116 of SimpleTesseract.au3. All I needed to do was change ShellExecuteWait(@ProgramFilesDir & "\tesseract\tesseract.exe", $capture_filename & " " & $ocr_filename) to ShellExecuteWait(@ProgramFilesDir & "\tesseract\tesseract.exe", $capture_filename & " " & $ocr_filename,"","",@SW_HIDE). This hides the window that ShellExecuteWait creates. It works well.
  6. wow, that is impressive! Thanks for the link.
  7. Howdy! I need to find out if a process is running on the SAME username as the currently running script. The current ProcessExists command checks to see if the process does indeed exist, no matter what the username. Is there any way to limit that?
  8. Good morning! (or afternoon) I've got a TPanel in an existing window which I'm trying to extract data from. The only way I have found so far is to use use OCR (_TesseractScreenCapture). It captures well, but sadly it causes a black CMD window to flash on the screen. This is quite distracting to the user, who has just opened a new window and is preparing to type in some information. So my question is: Is there some way to extract the data from the TPanel control? The data/text I'm trying to capture is NOT in the Hidden Text, or Text data of the window.if not, is there some way to HIDE the flash of the black CMD window?Thank you for any hints or tips!
  9. Ahh, it works with BMP files. I wonder if this could be added to the help file, possibly in the GUICtrlCreateButton page? or a note on GUICtrlSetImage. This topic can now be closed, but may be handy as future reference to other newcomers who stumble at the same thing.
  10. I can't seem to load an image onto a button. Are there special requirements for the size or type that are different than for GUICtrlCreatePic? Here's the code with a button which SHOULD have an image on it. GUICtrlCreatePic works fine. I've tried JPG,BMP,GIF with the button. No luck yet. Any ideas? #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> $pic_path = "path/to/image" $hGUI = GUICreate("Test", 400, 500) $hPic = GUICtrlCreatePic($pic_path, 10, 10, 380, 380) $hButton = GUICtrlCreateButton("Boo", 10, 400, 80, 80, $BS_BITMAP) GUICtrlSetImage($hButton, $pic_path) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hPic MsgBox(0, "Hi!", "You clicked the picture") Case $hButton MsgBox(0, "Hi!", "You clicked the button") EndSwitch WEnd
  11. Thanks. I've been using AutoIt for a while now. Currently I'm designing an interface which 'assists' an older database program which we use. My interface (a dropdown, input box, and a couple labels) sits in empty realestate within the other programs window. It moves when the other program window moves. It looks like it belongs there. My goal is so the end user can do what they normally do, as well as have two more input boxes which are easy to use. One thing that I wish AUtoIt had was array management like php. I LOVE php's arrays! I'm using a scripting dictionary instead. This works, but of course is far from optimal. I use ControlGetTxt. The issue that I'm having right now is that I don't want to call ControlGetTxt within a tight loop, just to check the status of two inputs. I'd rather do one call to GUIGetMsg, then use the return value from that to determine if a control within the parent window has changed. Thanks for your help though! I think I'll make a small internal timer, something like If mod(TimerInit(),500) = 0 AND ControlGetText("window title",'',$some_handle) Then ; do something. Note that having the mod(TimerInit(),500) = 0 IN FRONT of the ; 'AND' keywords should cause the 2nd condition to only be checked every 500 milliseconds EndIf
  12. With non-AutoIt created controls, I can hide, show, enable, disable, set text, and do a number of other things. That is quite handy. Is there a way to WATCH non-AutoIt controls with either GUIGetMsg (in a loop) or another method? Currently GUIGetMsg only seems to pickup on events from the AutoIT created GUI, not other windows or controls. And it STOPS receiving events if something other than the AutoIT created GUI has focus. I've tried setting GUISwitch to the handle of the non-AutoIT window, but it still can't seem to catch non-AutoIT control events. What would you guys suggest?
×
×
  • Create New...