Jump to content

craigey1

Members
  • Posts

    8
  • Joined

  • Last visited

craigey1's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. If I use the 2+16 the files are not even created. Binary isn't valid, but binarystring is. This returns null. It just appears that once binary is encountered in the Recordset the value is set to null. All the jpgs appear as 0KB files.
  2. I've posted the whole lot. Please note there are a lot of comments etc, where I have been trying to get this to work. I've so far been successfull in outputting normal records (ie names etc) to txt files or within a jpg file when view with wordpad. This just doesn't seem to read the BLOB's. #include <GUIConstants.au3> Dim $oMyError ; Initializes COM handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $ado = ObjCreate( "ADODB.Connection" ) ; Create a COM ADODB Object with the Beta version With $ado ; 'Set data source - for OLEDB this is a tns alias, for ODBC it can be 'either a tns alias or a DSN. ; If "provider" is used this means that the ODBC connections is used via DSN. ; if Driver is used = "Driver={Microsoft ODBC for Oracle};Server=TNSnames_ora;Uid=demo;Pwd=demo;" then this is a DSN Less connector ; More Info for Oracle MS KB Q193332 .ConnectionString =("Provider='OraOLEDB.Oracle';Data Source='XXXXXX';User Id='xxxxxx';Password='xxxxxx';") .Open EndWith $adors = ObjCreate( "ADODB.RecordSet" ) ; Create a Record Set to handles SQL Records #Region --- CodeWizard generated code Start --- ;InputBox features: Title=Yes, Prompt=Yes, Default Text=Yes, Mandatory If Not IsDeclared("sInputBoxAnswer") Then Local $sInputBoxAnswer $sInputBoxAnswer = InputBox("SQL Query","Please Enter The SQL Query to use.","Select content From images"," M","-1","-1","-1","-1") Select Case @Error = 0;OK - The string returned is valid Case @Error = 1;The Cancel button was pushed Exit Case @Error = 3;The InputBox failed to open Exit EndSelect #EndRegion --- CodeWizard generated code End --- With $adors .ActiveConnection = $ado ;.CursorLocation = "adUseClient" ;.LockType = "adLockReadOnly"; Set ODBC connection read only ; .Source = "select camerastatusdata from camerastatus" .Source = $sInputBoxAnswer .Open EndWith $j=0 While not $adors.EOF For $i = 0 To $adors.Fields.Count - 1 ; ConsoleWrite( $adors.Fields( $i ).Value & @TAB ) ; Columns in the AutoIt console use Column Name or Index msgbox(1,"test",$adors.Fields($i).Value) ; msgbox(1,"test",Hex($adors.Fields($i).Value)) ; msgbox(1,"test",BinaryString($adors.Fields($i).Value)) ;msgbox(0,"",$i) ;msgbox(0,"",$j) ;msgbox(0,"",$adors.Fields($i).Value) ;$file = FileOpen(@ScriptDir & "\test"&$j&".jpg", 1) ;$filename = @ScriptDir & "\test"&$j&".jpg" $file = FileOpen("C:\test"&$j&".jpg", 1) $filename = "C:\test"&$j&".jpg" msgbox(0,"",$filename) FileWrite($filename, $adors.Fields($i).Value) ;FileWrite($file, @CRLF) ;FileWrite($filename, $filename) FileClose($filename) ;RunWait("rundll32.exe C:\WINDOWS\system32\shimgvw.dll,ImageView_Fullscreen" &$filename) RunWait("C:\windows\system32\mspaint.exe "&$filename) $j=$j+1 Next ; ConsoleWrite(@CR) $adors.MoveNext ; Go to the next record WEnd ; This COM error Handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) $iMsgBoxAnswer = Msgbox(1,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Select Case $iMsgBoxAnswer = 1;OK Case $iMsgBoxAnswer = 2;Cancel Exit EndSelect Endfunc
  3. Hi, I'm trying to export BLOB data from my oracle database & export it to a jpg file. So far I can connect to the DB & Display (some of) the blob in a msgbox. How can I export that variable value to a jpg file? I've got the Auto3Lib installed & thought I could use the GDIP_ImageSaveToFileEx function in A3LGDIPlus.au3, but haven't had any luck. Any help would be apreciated. Thanks
  4. Is there any way to edit the PATH variable using autoit? I've tried searching, but there are lots of threads with the words path, system & variable in them! I just need to do a simple replace on the jdkpath, but obviuosly I need to beable to read & write to it. Thanks
  5. Hi, The script doesnt seem to handle the Following: turbine_file = "turbineresources.properties" turbine_file_path = "c:\mydir\webapp\web-inf\conf\" drivelet = "" Set fso = CreateObject("Scripting.FileSystemObject") Dim Drive, AllDrives Set fsObj = CreateObject("Scripting.FileSystemObject") Set AllDrives = fso.Drives dim drivelet_arr(10) Found = 0 For Each Drive in AllDrives If Drive.DriveType = 2 Then Set filesystem = CreateObject("Scripting.FileSystemObject") If filesystem.FileExists(Drive.DriveLetter+":\"+turbine_file_path+turbine_file) Then found = found+1 drivelet_arr(found) = Drive.DriveLetter end if end if Next Set Drive = nothing Set AllDrives = nothing set fso = nothing set filesystem = Nothing I'm sure I can use the "DriveGetType" in AutoIt to get the same info into the array, but is it possible to get the converter program updated to do this automatically. Thanks
  6. Thanks Both of You. 2nd option is definately easier to use, though! Thanks again
  7. Thanks will give it a shot tomorrow sometime, it's 2am & I've had enough of staring at my dodgy code! Time for bed!
  8. Hi All, I'm Having some difficulty Navigating Folders & was hoping someone could help out. I Have a directory structure something like: (please ignore the ".") ....<.......CD.........> ..|...........................\ ..|.............................\ ..|..............................\ Folder A................Folder B ..|...............................| SCRIPT .au3...........FILE.vbs I can get the current script path using "@ScriptDir", but I'm having difficulty trying to navigate to "Folder B". When I was using vbscript I was using the function INSTREV like so: UponeFolder_tmp = Left(script_path, InstrRev(script_path, "\")-1) UponeFolder = Left(UponeFolder_tmp, InstrRev(UponeFolder_tmp, "\")) Any ideas / advice as to how I can do this with AutoIT? Thanks in Advance
×
×
  • Create New...