Here is my code:
Code:
Set xResult = New Collection
Set rs = New ADODB.RecordSet
rs.Open cSQL, gConnection, adOpenForwardOnly, adLockReadOnly, adCmdText
With rs
While Not .EOF
Set xItem = New VersionInfo
xItem.VersionID = .Fields("VersionID")
If Not IsNull(.Fields("VersionDescription")) Then
Dim lngOffset As Long
Dim lngLogoSize As Long
Dim varlogo As Variant
Dim varChunk As Variant
lngOffset = 0
varlogo = ""
varChunk = ""
lngLogoSize = .Fields("VersionDescription").ActualSize
Do While lngOffset < lngLogoSize
varChunk = .Fields("VersionDescription").GetChunk(100)
varlogo = varlogo & varChunk
lngOffset = lngOffset + 100
Loop
xItem.AdditionalInfo = varlogo
End If
xResult.Add xItem
.MoveNext
Wend
End With
I found that it works for my provider only in case that SQL query doesn't contain JOIN(s). It was mentioned in link above. The simply select query from one table will not cause problem. I've tried to check also MSDASLQ provider and i found that it doesn't truncate longs as one for oracle.