Results 1 to 2 of 2

Thread: Oracle/VBA/BLOB

  1. #1
    Join Date
    Dec 2004
    Posts
    78

    Question Unanswered: Oracle/VBA/BLOB

    I have a table with a BLOB column which I need to read when a button is pressed. I am using the following code but getting error (at myStreaM.Write ) as:
    Run-time error 3001 - Arguments are of wrong type, are out of acceptable range, or are in conflict with each other.

    Code:
    Sub BlobTest()
        Dim conn As ADODB.Connection
        Set conn = New ADODB.Connection
        Dim ProdConnectString
        ProdConnectString = "provider=msdaora.1;user id=user;password=pass1;data source = dbsource;option=1+2+8+32+2048+16384"
        conn.CursorLocation = adUseClient
        conn.Open ProdConnectString
        Dim rs As ADODB.Recordset
        Set rs = New ADODB.Recordset
        Dim myStreaM As ADODB.Stream
        Set myStreaM = New ADODB.Stream
        myStreaM.Type = adTypeBinary
        rs.Open "select ATTACHSYSFILENAME from TestTable where  ID = '1'", conn, adOpenKeyset, adLockOptimistic
        myStreaM.Open
        myStreaM.Write (rs.Fields("ATTACHSYSFILENAME").Value)
    '    mystream.Write rs!ATTACHSYSFILENAME
        myStreaM.SaveToFile "c:\temp\readme.txt", adSaveCreateOverWrite
        myStreaM.Close
        rs.Close
        conn.Close
    End Sub
    Can anyone help me figure out what is wrong or is there anything I need to change? I have added the Microsoft ActiveX data objects 2.7 library.

    Thanks.
    ~BS

  2. #2
    Join Date
    Dec 2004
    Posts
    78

    Thumbs up

    Sorry, posted the same post twice.
    See http://www.dbforums.com/t1119153.html for solution

    Thanks.

    ~BS.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •