Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need VBA code to download bmp stored as longraw in Oracle?

Status
Not open for further replies.

aspengal

Technical User
Dec 27, 2004
41
US
Folks, Can someone help me with downloading bmp stored as longraw data? I tried following some examples using getchunk() but it wont work. the resulting bmp file is always having some extra bytes attached to it and hence wont open. If the actual bmp size is 1.19 MB, then the downloaded file is 1.2 MB. Please help!!!!
 
can you please show us the code you have tried so far...

That will enable us to give you a quicker solution, as it seems you have already done part of the work.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Thanks for the reply.. This is the code. Could you tell me how to find the length of this longraw data? I tried lenB(rs.fields(0)) but this again gave a few extra bytes..Help!

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=******;Persist Security Info=False"
Set Cn = New ADODB.connection
Cn.Open (strConn)
Debug.Print Cn.ConnectionString

strsql = "SELECT document_data FROM
SAR_SAR_FAC_FILE_CABINET WHERE
SAR_SAR_FAC_FILE_CABINET.FACILITY_NO=204777"
Set rs = New ADODB.Recordset

rs.Open strsql,strConn,adOpenKeyset,adLockOptimistic
Dim strstream As ADODB.Stream
Set strstream = New ADODB.Stream
strstream.Type = adTypeBinary
strstream.Open
strstream.Write rs.Fields(0).Value
strstream.SaveToFile "C:\Temp.bmp", adSaveCreateOverWrite
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top