Jump to content

stockboy

Active Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by stockboy

  1. @ptrex It gives the following error's: 1) 2) 3) What's wrong ? Tnx Stockboy
  2. CODE$ado = ObjCreate( "ADODB.Connection" ) With $ado .ConnectionString =("Provider='OraOLEDB.Oracle';Data Source=" & $SID & ";User Id='xxxx';Password='xxxx';") .Open EndWith $adors = ObjCreate( "ADODB.RecordSet" ) With $adors .ActiveConnection = $ado .Execute ("UPDATE PRN_SYSTEEM SET WAARDE = '060204' WHERE CODE = 'PROGRAMVERSIE+'") .Open EndWith While not $adors.EOF For $i = 0 To $adors.Fields.Count - 1 FileWriteLogOracle($pad6 &"Parn_060204.log",$adors.Fields( $i ).Value & @TAB) Next $adors.MoveNext WEnd @Ptrex (or other experts ;o) Something like this? What am I doing wrong? It still gives an error TNX Stockboy
  3. @bala you're probably right, I don't think I can hide it... P.S. I can select an application to continue but I don't think it's possible to select a process to continue...
  4. @SW_SHOWMINIMIZED gives it mimimized but @SW_HIDE does not work. It gives the first screen, hides it... after hiding the script doesn't go further anymore... Without 'winsetstate' the script works perfect (but than it's not hidden of course)
  5. CODEWinSetState("Aphrodite - Upgrade & Install", "OK") WinWait("Aphrodite - Upgrade & Install") ControlClick ( "Aphrodite - Upgrade & Install", "OK", 2) WinSetState( "WinZip Self-Extractor - Persm050102-0008UI.exe", "Unzip") WinWait("WinZip Self-Extractor - Persm050102-0008UI.exe") ControlSend ( "WinZip Self-Extractor - Persm050102-0008UI.exe", "Unzip", 106, $pad6 ) ControlClick ( "WinZip Self-Extractor - Persm050102-0008UI.exe", "Unzip", 1) WinSetState("WinZip Self-Extractor - Password", "password") WinWait("WinZip Self-Extractor - Password") ControlSend ( "WinZip Self-Extractor - Password", "password", 402, "xxxx" ) ControlClick ( "WinZip Self-Extractor - Password", "password", 1) This script unzips Persm050102-0008UI.exe. It gives 3 screens. I have to fill in a path, press a few buttons and give in a password. 1) Is it possible to run this completely hidden. Can't get it done with @HIDE. 2) When 1) is solved, do you think it's possible to run this (as a service) on a server where NOBODY is logged on? THX for helping me
  6. @ptrex I mean: 'edit' the database (insert, update, etc...) If I use: "select upgrade_version ||''||upgrade_build from ci_toepassing where kode like 'CI'" the script works. If I use: "update mnbarm set MNBARMART60MAXSOCECONEUR = 21356.63 where mnbarmmaand >= '01-JAN-07'" it gives this error: "operation is not allowed when the object is closed"
  7. This script connects to an oracle database, gets the version of the program 'CI' and writes it in version.log. My question: what do I have to change, in the script, to PUT data in the database instead of GET data. For example: "update mnbarm set MNBARMART60MAXSOCECONEUR = 21356.63 where mnbarmmaand >= '01-JAN-07'" instaed of "select upgrade_version ||''||upgrade_build from ci_toepassing where kode like 'CI'" I know... I don't know much 'bout databases, shame on me ;o) ------------------------------------------------------------------------------ Dim $oMyError $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $ado = ObjCreate( "ADODB.Connection" ) With $ado .ConnectionString =("Provider='OraOLEDB.Oracle';Data Source='mig2';User Id='cipal';Password='xxxx';") .Open EndWith $adors = ObjCreate( "ADODB.RecordSet" ) With $adors .ActiveConnection = $ado .Source = "select upgrade_version ||''||upgrade_build from ci_toepassing where kode like 'CI'" .Open EndWith While not $adors.EOF For $i = 0 To $adors.Fields.Count - 1 FileWriteLogOracle("c:\version.log",$adors.Fields( $i ).Value & @TAB) Next $adors.MoveNext WEnd Func MyErrFunc() Endfunc Func FileWriteLogOracle($sLogPath, $sLogMsg) EndFunc
  8. That's all I needed to know. I'm going to try it the way you described above. I'm also pretty sure it should work. You rule :-) TNX A LOT !!
  9. @ptrex I understand what you mean but I want to execute the sql-script with oledb (so without starting sqlplus). But I'm not sure if its possible...
  10. I connect to the Oracle database as follows, works fine: Dim $oMyError $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Initializes COM handler $SID = $var1[1][1] $ado = ObjCreate( "ADODB.Connection" ) ; Create a COM ADODB Object with the Beta version With $ado .ConnectionString =("Provider='OraOLEDB.Oracle';Data Source=" & $SID & ";User Id='xxxxx';Password='xxxxx';") .Open EndWith $adors = ObjCreate( "ADODB.RecordSet" ) ; Create a Record Set to handles SQL Records With $adors .ActiveConnection = $ado .Source = "select waarde from parnassus.prn_systeem where code = 'DATABASEVERSIE'" .Open EndWith While not $adors.EOF For $i = 0 To $adors.Fields.Count - 1 FileWriteLogOracle($pad6 &"parnassus.log",$adors.Fields( $i ).Value & @TAB) Next $adors.MoveNext ; Go to the next record WEnd $ado.Close My question: instead of this function (select waarde from parnassus.prn_systeem where code = 'DATABASEVERSIE') I want to run an external sql-file (parnassus.sql) and log the result... Anyone can help me? TNX a lot The external sql-file (parnassus.sql) contains for example: DROP TRIGGER PRN_TRG_TEKSTEN_COMMENTAAR; DROP SEQUENCE PRN_SEQ_TEKSTEN_COMMENTAAR; DROP TABLE PRN_TEKSTEN_COMMENTAAR; ALTER TABLE PRN_TEKST_COMMENTAAR ADD ( CONSTRAINT PRN_TEKST_C_PRN_LID_FK FOREIGN KEY (LID_NRQ) REFERENCES PRN_LEDEN (NRQ)); ALTER TABLE PRN_TEKST_COMMENTAAR ADD ( CONSTRAINT PRN_TEKST_C_PRN_BIJLAGE_FK FOREIGN KEY (TEKST_NRQ) REFERENCES PRN_TEKST (NRQ));
  11. lod3n & Joon Thanks a lot, very useful, my 'search' is over ;o)
  12. I have an application or.exe in directory r:\or.exe The dll's for this application are in r:\main\dk (I can start this or.exe if I copy the dll's from r:\main\dk to r:\) Why does it not start when I use one of those scripts? EnvSet("PATH","%PATH%;r:\main\dk") Run("r:\or.exe", "r:\") or EnvSet("PATH","r:\main\dk") Run("r:\or.exe", "r:\") Somebody can help me? TNX
  13. It's quite simple but I couldn't find it... TNX a lot!
  14. In this script I make a connection to an oracle databank (DEV1). $ado = ObjCreate( "ADODB.Connection" ) With $ado .ConnectionString =("Provider='OraOLEDB.Oracle';Data Source='DEV1';User Id='x';Password='x';") .Open EndWith I want to replace this DEV1 to a variable. Something like this (but it's not working - problem with the quotes I guess): $var =[name databank] $ado = ObjCreate( "ADODB.Connection" ) With $ado .ConnectionString =("Provider='OraOLEDB.Oracle';Data Source=$var;User Id='x';Password='x';") .Open EndWith Anybody? TNX
  15. Same error: it starts when my browser is already open, else => error
  16. I want to start a web page with the default browser (ie, gozilla, ...) If I use this script it only works when my browser is already open (else I get an error) $url = "http://www.google.be" Run(@Comspec & " /c start " & $url) What's wrong?
  17. TNX Lempke... it works, you made my day!!! $String = 'Hello-World' $OutPut = StringLeft($String, StringInStr($String, 'Hello') + 4) MsgBox(0, "String", $OutPut)
  18. So say i have a string like this: example 1) Hello-World example 2) Testing, Hello-World Testing How would i delete everything AFTER the word 'Hello': example 1) Hello example 2) Testing, Hello Keeping in mind that the string lengths and character positions change, but always follow this format. This topic is simular: http://www.autoitscript.com/forum/index.ph...mp;hl=character TNX a lot
  19. Indeed, it makes the script more easier... thanx a lot !!
  20. @smalhly: I need to copy a part of a ini-file and than open another ini-file (instserver.ini), search in it, and than paste Maybe it's easy but you're talking to a beginner here ;o) @jinxter: You're right, it works without the FileOpen Tnx a lot !!!
  21. The next simple script opens "instserver.ini", writes "testing" and than closes '"instserver.ini". Normally it should save but I always get this error.: There is nothing wrong with the rights on this file. When I do the same thing manually it saves without a problem. Any ideas? Tnx $FilePath = "r:\1apps\main_persm\instserver\instserver.ini" $FileHandle = FileOpen($FilePath, 1) Run("notepad " & $FilePath) WinWaitActive("instserver.ini") send("testing") WinClose("instserver.ini") WinWaitActive("Notepad") ;Do you want to save the changes? Send("!y") WinClose("Notepad")
×
×
  • Create New...