VB Databases BasicsBeginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the VB Databases Basics section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
Retriving Binay Image From SQL Server 2000 In VB 6
i want to retrive the image from SQL server 2000 image data type and want to display the image in the picture box of visual basic 6. i have added the image in SQL server 2000 but retrving is the problem can any one help me plz............
Dim Flds As ADODB.Fields
Dim fld As ADODB.Field
Dim byteChunk() As Byte
Dim strNote As String
Dim Offset As Long
Dim Totalsize As Long
Dim Remainder As Long
Dim NumOfChuncks As Long
Dim CurrentRecPos As Long
Dim FieldSize As Long
Dim FileNumber As Integer
Const HeaderSize As Long = 78
Const ChunkSize As Long = 100
Const TempFile As String = "tempfile.tmp"
FileNumber = FreeFile
Open TempFile For Binary Access Write Lock Write As FileNumber
Totalsize = FieldSize - HeaderSize ' Substract it from the total size.
byteChunk() = fld.GetChunk(HeaderSize) ' Get rid of the header.
NumOfChuncks = Totalsize \ ChunkSize
Remainder = Totalsize Mod ChunkSize
If Remainder > 0 Then
byteChunk() = fld.GetChunk(Remainder)
Put FileNumber, , byteChunk()
End If
Offset = Remainder
Do While Offset < Totalsize
byteChunk() = fld.GetChunk(ChunkSize)
Put FileNumber, , byteChunk()
Offset = Offset + ChunkSize
Loop
Close (FileNumber)
Image1.Picture = LoadPicture(TempFile)
Kill (TempFile)