Jump to content

Mr. Crimson

Active Members
  • Posts

    36
  • Joined

  • Last visited

Mr. Crimson's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I've been trying this method out with little success due to the aforementioned memory leak. It's strange, because I know I've used ADO Objects in loops before, but perhaps it's related more to the object being loaded? I am also able to "Fix" the problem by commenting the refresh segment out, but unfortunately, I need the process memory. -Mr. Crimson
  2. I got it! $cmd.CommandText = "Update patchlist SET patchstatus = 'Available' WHERE patchID in (Select Top 2 patchID From patchlist Order By patchID DESC)" Best- Crim
  3. Thank you for the reply, here's the error message it gives: Best- C
  4. Howdy all- I'm a bit at a loss so here goes nothing... I have an Access database which I'm attempting to do an UPDATE to using AutoIt, the trick of course, being that I only want to update the latest two records in the list. Here's sort of what I want to do, but the example below does not work as hoped, and I get an error that the action with that object has failed: $cmd.CommandText = "Update patchlist SET patchstatus = 'notinstalled' From (Select Top 2 patchID From patchlist Order By patchID DESC) AS Latest Where patchlist.patchID = Latest.patchID" I can do straight up UPDATE and SELECT statements, but this one has been a total bear... it doesn't help that I'm still a bit of a SQL Query n00b. Please let me know if you need more info. Best Regards- Mr. Crim
  5. Thanks you all, that worked pretty well... I had a few small typos to fix, but the following worked perfectly... and I learned a new function! (Assign) Here's the final code that worked: If IsArray($acounti) Then For $iterator = 0 To 9 Step 1 If $acounti[$iterator] > 0 Then $gaatline = FileReadLine($filename, $acounti[$iterator]) Assign("agaatLine" & $iterator, StringSplit($gaatline, "|")) EndIf Next FileClose($filename) EndIf
  6. So I've had this durdge of probable unecessary extra lines in one of my scripts for a while, mainly due to my inability to wrap my brain around a way to loop a section of code so it cycles variables the way I need, so it doesn't break the other 3000 lines. Let me preface the showing of this code by saying this was one of the first scripts I wrote in AutoIt, so please be kind... I don't make these kinds of mistakes... often. If I did a total rewrite of the script, it'd look quite different now. I do the following, 30 times, with certain variables changing names in each section... When you look at the code, note that the only variables that change have "gaat" in their names. They change as a location code for each site, such as "gane" or "gase", again there's 30 different versions of those variables. I know there must be an easy way to do a loop so I only have to do it once, anyways, here's the code: ; Define variables Dim $gaat Dim $filename Dim $agaatLine ; Read UND Data From GAAT ; Load GAAT data $filename = FileOpen("C:\undsearch\gaat-und.csv", 0) ; Check if file opened for reading OK If $filename = -1 Then MsgBox(0, "Error", "Unable to open GAAT file.") Exit EndIf ; Read in lines of text until the EOF is reached DIM $acounti[1000] $counti = 0 DIM $resultcount $resultcount = -1 While 1 $counti = $counti + 1 $gaatline = FileReadLine($filename) If @error = -1 Then ExitLoop $stringfound = stringInstr($gaatline, $racfid) If $stringfound > 0 THEN $resultcount = $resultcount+1 _ArrayInsert( $acounti, $resultcount, $counti) EndIf $stringfound = 0 Wend IF IsArray($acounti) THEN IF $acounti[0]>0 THEN $gaatline = FileReadLine($filename,$acounti[0]) $agaatLine1 = StringSplit($gaatline,"|") EndIf IF $acounti[1]>0 THEN $gaatline = FileReadLine($filename,$acounti[1]) $agaatLine2 = StringSplit($gaatline,"|") EndIf IF $acounti[2]>0 THEN $gaatline = FileReadLine($filename,$acounti[2]) $agaatLine3 = StringSplit($gaatline,"|") EndIf IF $acounti[3]>0 THEN $gaatline = FileReadLine($filename,$acounti[3]) $agaatLine4 = StringSplit($gaatline,"|") EndIf IF $acounti[4]>0 THEN $gaatline = FileReadLine($filename,$acounti[4]) $agaatLine5 = StringSplit($gaatline,"|") EndIf IF $acounti[5]>0 THEN $gaatline = FileReadLine($filename,$acounti[5]) $agaatLine6 = StringSplit($gaatline,"|") EndIf IF $acounti[6]>0 THEN $gaatline = FileReadLine($filename,$acounti[6]) $agaatLine7 = StringSplit($gaatline,"|") EndIf IF $acounti[7]>0 THEN $gaatline = FileReadLine($filename,$acounti[7]) $agaatLine8 = StringSplit($gaatline,"|") EndIf IF $acounti[8]>0 THEN $gaatline = FileReadLine($filename,$acounti[8]) $agaatLine9 = StringSplit($gaatline,"|") EndIf IF $acounti[9]>0 THEN $gaatline = FileReadLine($filename,$acounti[9]) $agaatLine10 = StringSplit($gaatline,"|") EndIf EndIf FileClose($filename) If anyone has a suggestion for a relatively painless method of looping the affected variables, I'm willing to listen. If I could insert variable names inside of an array for use later, this would be much easier... or can I? I've never seen an example of this, so I'm not sure how you'd go about it. Thank you for your time! -Crim
  7. Hi Dale, I found a repeatable error when using the UDF, aren't you happy to hear that? (Insert Sarcasm Here) So it occurs when I attempt to lock onto the name of an existing IE window, (doesn't matter which), while I have my Anapod Explorer, (from Redchair software), window open for browsing my iPod files. The error message is this: When the Anapod window is not open, I do not get the error and it is able to interact with the IE window with no issues. Not sure if anyone else has had similiar problems, but I'd almost bet it's not limited to just the Anapod Manager. In any case, thanks again for all that you do Dale, you rule! Best Regards- Crim
  8. I'm not sure what version/update it was, but I have seen it occur with McAfee AV when emailing the person a compiled script. I ended up manually putting it on her desktop. It might have been her Exchange server too... Sorry no help, but I have seen this too! -Crim
  9. Hmmm.... I've had a few issues with timing myself, maybe you should go back and do a traditional WinWait for the javascript window and have it click the button using keystrokes... I could be wrong about this, you might still be on the right track... -Crim
  10. You can count which instance the link is as far as the first, second, or twentieth, and so on, and still use the _IEClickLinkByLink() function. I recently had to do that for the first time, although I used the _IEClickImg() function, as shown below: _IEClickImg($oFrame, "linktoimage.gif", "src", 0) Where 0 is the first instance of the image, and say, 5 would be the 6th instance of the image. (Sorry, only half my thoughts went onto the page... edits above) Best Regards- -Crim
  11. One other little thing, can you provide an example of proper usage of the _IEAttach function? I've tried: $oIE = _IEAttach ("classname=Internet Explorer_Server1") But it doesn't seem to properly attach. (EDIT: Doh, I figured it out, looking at the function header, here's what I corrected it to below for anyone else to use:) $oIE = _IEAttach ("http://www.yoursite.com", "URL") Thanks again! -Crim
  12. Yep, occasionally, (it's around 1500 lines right now for the code that interacts with the windows). Func _Hider() If $docked = 0 Then WinMove("Action Code Inputter", "", @DesktopWidth-280, 0) $docked=1 ElseIf $docked = 1 Then WinMove("Action Code Inputter", "", @DesktopWidth-280, -1000) $docked=0 EndIf EndFunc and WinMove("Action Code Inputter", "", @DesktopWidth-280, 0) Would using the negative coords to hide the GUI window make it prone to this issue? Or could it be something else? Thanks Larry! -Crim
  13. considering there is no code snippit to help us reproduce and debug... I think dumb is probably the answer. There must be a variable involved... We'll need to see the GUICreate() at least. Lar. Larry- Here you go: GUICreate("Action Code Inputter", 225, 620, -1, -1, $WS_MINIMIZEBOX, $WS_EX_TOPMOST) Like I said, it works fine generally, but I do tweaks to it all the time and occasionally it'll become crazy big in height. Thanks! -Crim
  14. First off a big big thanks to Dale for his tireless efforts in educating the unclean masses, (myself of course included), as I've been following this thread since it started with much interest. I read through the thread a couple of times, but I still may have missed it, but here goes... In post 37 Dale shows a great example of how to grab all the elements off of a page. This has been invaluable for me so far, since the page I'm trying to automate doesn't allow you to read the source code directly. I've been able to get it to login to the page so I can try to poll the list of elements in the page, but when I try to read in the page after logging in, there's a nice list of elements including about 9 frame elements, which seems as though it is reading correctly, just not picking up the stuff out of the frames themselves. How do I pick the stuff out of those frames? Keep in mind I have no way to access the source code of the page as rt click and view source are both disabled. At least I have frame element names now. Thanks again! -Crim
  15. This has to be something I'm doing wrong, but has anybody else come across an occasional issue where the GUI height becomes, from what I can tell, infinitely tall? The weird thing is, is that usually just removing a commented line will fix it, but it may be that any change to the file "fixes" it. To further complicate things sometimes it will affect one machine and not others, even when on the same OS, (XP). Please tell me I'm not going crazy. I hope I'm just doing something dumb, like usual. -Crim
×
×
  • Create New...