Dear Experts Here is a code I wrote Using AppendChunk & GetChunk
Thaugh I 'm new to this (Old with VB) I receive only 50 % of the file I save
Do I miss somethiong ( Or I Mess it ???)
VB6.0 SP5.0 ADO 2.6
Dim RSAtt As ADODB.Recordset, FileBuffer As String
Dim lngPos As Long, FileTitle As String, I As Integer, FileLen As Long
FileToAtt = "c:\autoexec.bat"
lngPos = InStrRev(FileToAtt, "\")
FileTitle = Mid(FileToAtt, lngPos + 1)
Set RSAtt = New ADODB.Recordset
RSAtt.Open "SELECT * FROM Attachements ", PubVar.DB, adOpenKeyset, adLockOptimistic
Open FileToAtt For Binary As #1
FileBuffer = String(LOF(1), " ")
Get #1, , FileBuffer
RSAtt!FileName = FileTitle
RSAtt!FileLen = Len(FileBuffer)
FileToXtr = "C:\test.bat"
Open FileToXtr For Binary As #1
FileLen = RSAtt!FileLen
FileBuffer = String(FileLen, " ")
FileBuffer = RSAtt.Fields("Attached").GetChunk(FileLen)
Put #1, , FileBuffer
Hope some help !!!!