i want to convert a fie(document,excel,picture) to binary format using VB.Please how can i achieve this
what exactly you mean by binary format ?
You will firstly need to reference "MS Scripting Library"
The code will be something like -
Dim oPict As StdPicture 'Change this for other objects, formats etc... Dim sDir As String Dim sTempFile As String Dim iFileNum As Integer Dim lFileLength As Long Dim abBytes() As Byte Dim iCtr As Integer On Error GoTo ErrHandler sTempFile = FileGetTempName iFileNum = FreeFile Open sTempFile For Binary As #iFileNum lFileLength = LenB(adoRS(sFieldName)) abBytes = adoRS(sFieldName).GetChunk(lFileLength) Put #iFileNum, , abBytes() 'This is the break down into bytes. Close #iFileNum oPictureControl.Picture = LoadPicture(sTempFile) Kill sTempFile Exit Function
debasisdas ~ binary format like using 0 and 1
andreRet ~ is it for image??
Yes it is for a picture/image. It works wonders if you want to break it into small byte chunks, especially for databases.