Jump to content
Sign in to follow this  

ADODB AppenChunk

Recommended Posts



I want to store a picture (binary data) in an oracle db.

I found some examples with the method 'AppendChunk', but it doesn't want to work.

$connect = "localhost;kopfrechner;kopfrechner"
    $connect = StringSplit($connect,';')
    $ORA_dbc = ObjCreate( "ADODB.Connection")
    ;$ORA_dbc.Open("Driver={Microsoft ODBC for Oracle};Server=" & $connect[1] & ";Uid="&$connect[2]&";Pwd="&$connect[3]&";")
    $ORA_dbc.Open("Driver={Oracle in XE};Server=" & $connect[1] & ";Uid="&$connect[2]&";Pwd="&$connect[3]&";")
    $adores = ObjCreate( "ADODB.RecordSet" )
    $adostream = ObjCreate( "ADODB.Stream" )
    ConsoleWrite("DB Connection Status = " & $adores.State & @CR)
    $adostream.Type = 1
    $ORA_dbc.execute("UPDATE KR_TBL_TEST SET bild = empty_blob() WHERE id_test = 2")
    With $adores
    ;$SQLstatement="select bild from KR_TBL_TEST where id_test=1;"
        .Source = "select bild from KR_TBL_TEST where id_test=2"
        ;$streamread = $adostream.read
        ;For $adofield in $adores.Fields
        ;   MsgBox(0, "Title", $adofield.Name)
            ;$adofield.AppendChunk ($adostream.read)



All works fine but the AppendChunk doesn't.

Here ist the Error:

D:\AutoIT\test2.au3 (25) : ==> The requested action with this object has failed.:
$adores.Fields("bild").AppendChunk($adostream.read)^ ERROR

Does anyone of you see the failure or have an idea for a workaround ?



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this