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

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….
 
N

Norm Cook

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top