Retrieving large text files from OLE object filed of a MS Access 2

  • Thread starter Thread starter Nam
  • Start date Start date
N

Nam

I have stored large text files in an OLE object filed of a MS Access 2003
table. How can I retrieve and display these files using VBA or VB6? Any
reference and/or a simple code example will help.

Thanks in Advance….
 
Nam said:
I have stored large text files in an OLE object filed of a MS Access 2003
table. How can I retrieve and display these files using VBA or VB6? Any
reference and/or a simple code example will help.

Thanks in Advance..

AppendChunk to save data, GetChunk to read
This is VB6, DAO:

Private Sub SaveBlob(RS As DAO.Recordset, FieldName As String, Txt As
String)
Dim B() As Byte
B = StrConv(Txt, vbUnicode)
With RS
.AddNew
.Fields(FieldName).AppendChunk B
.Update
End With
End Sub
Private Function ReadBlob(RS As DAO.Recordset, FieldName As String) As
String
Dim B() As Byte
Dim Siz As Long
With RS.Fields(FieldName)
Siz = .FieldSize
ReDim B(Siz)
B = .GetChunk(0, Siz)
End With
ReadBlob = StrConv(B, vbFromUnicode)
End Function
 
Back
Top