If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Oracle/VBA/BLOB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-21-05, 16:43
bhavesh78 bhavesh78 is offline
Registered User
 
Join Date: Dec 2004
Posts: 78
Question 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
Reply With Quote
  #2 (permalink)  
Old 03-02-05, 14:55
bhavesh78 bhavesh78 is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On