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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading a CLOB datatype in VB

Status
Not open for further replies.

AQWQ

Programmer
Aug 5, 2001
33
IN
Hi all,

Could any one help in retrieving a CLOB datatype from Oracle 8i using ADODB in VB.

Thanx in Advance Santhosh Ravindran
 
Hi AQWQ,

i've written a little sub to save a BLOB into a file:

const BufferSize = 1024

Public Sub Load_Blob(FileName As String)
Dim FileNum As Integer
Dim Value
Dim Buffer() As Byte
Dim rs As ADODB.Recordset
Dim sql As String

set rs = New ADODB.Recordset
sql = "" ' your SQL Statement
rs.Open sql, Ora_Con, adOpenKeyset, adLockOptimistic
If Not rs.EOF Then
FileNum = FreeFile
Open FileName For Binary As FileNum
Do
Value = rs(<FieldName>).GetChunk(BufferSize)
If Not IsNull(Value) Then
Buffer = Value
Put #1, , Buffer
Value = vbEmpty
Else
Exit Do
End If
Loop Until False
Close FileNum
End If
rs.Close
Set rs = Nothing
End Sub

I hope it's usefull.

bye
LauDse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top