| | |
loading images from sql server using vb6
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Please find a related article here. the code is for access . You just need to change the connection string for SQL Server.
Share your Knowledge.
Not bad at all, but the file using is a bit messy. Byte array can be opened as a file this way:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Const SIPICTURE As String = "{7BF80980-BF32-101A-8BBB-00AA00300CAB}" Private Type guid Data1 As Long Data2 As Integer Data3 As Integer Data4(7) As Byte End Type Private Declare Function CreateStreamOnHGlobal Lib "OLE32.DLL" (ByRef hGlobal As Any, ByVal fDeleteOnResume As Long, ByRef ppstr As Any) As Long Private Declare Function OleLoadPicture Lib "olepro32.dll" (ByVal lpStream As IUnknown, ByVal lSize As Long, ByVal fRunMode As Long, ByRef riid As guid, ByRef lplpObj As Any) As Long Private Declare Function CLSIDFromString Lib "OLE32.DLL" (ByVal lpsz As Long, ByRef pclsid As guid) As Long Private Function chunk2ipicture(ByRef b() As Byte) As IPicture Dim istrm As IUnknown Dim tGuid As guid If Not CreateStreamOnHGlobal(b(LBound(b)), False, istrm) Then CLSIDFromString StrPtr(SIPICTURE), tGuid OleLoadPicture istrm, UBound(b) - LBound(b) + 1, False, tGuid, chunk2ipicture End If Set istrm = Nothing End Function
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Data collection from Excel file through VB-6 using record set
- Next Thread: How do i send and receive an SMS using VB
Views: 2025 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection copy creat ctrl+f data database datareport date delete dissertations dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






