Home > Software engineering >  In SQL sever 2008 photo column is the image type, deposit is binary data, now want to in vb6.0 by us
In SQL sever 2008 photo column is the image type, deposit is binary data, now want to in vb6.0 by us

Time:01-02

Public Sub showimage (imagen As Image, adodcn As Adodc)
Dim bytechunk () As Byte
Fieldsize=adodcn. You. Fields (" Photo "). ActualSize
If fieldsize & lt;=0 Then
Imagen. Picture=LoadPicture (" ")
The Exit Sub
End the If
Sourcefile=FreeFile
The Open tempfile As expected For Binary Access Write As sourcefile
Numblocks=fieldsize \ blocksize
Leftover=fieldsize Mod blocksize
If leftover & lt;> 0 Then
ReDim bytechunk (leftover) As Byte
Bytechunk ()=adodcn. You. Fields (" Photo "). GetChunk (leftover)
Put the sourcefile, bytechunk ()
End the If
For I=1 To numblocks
ReDim bytechunk (blocksize) As Byte
Bytechunk ()=adodcn. You. Fields (" Photo "). GetChunk (blocksize)
Put the sourcefile, bytechunk ()
Next I
The Close sourcefile
Imagen. Picture=LoadPicture (tempfile as expected)
The Kill (tempfile as expected)
End Sub

Error in the open tempfile as expected for binary access write as sourcefile
This function is write read pictures
  • Related