| | |
problem in picture display...
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
hi, i have a project here that can insert the picture in the database by binary. but the problem is to search it using the "find" this is the codes that i upload in the net...
Dim sourceFile As Integer
sourceFile = FreeFile
Open fileName For Binary Access Read As sourceFile
fileSize = LOF(sourceFile)
If fileSize = 0 Then
Close sourceFile
MsgBox "Employee's Photo is invalid"
Exit Sub
Else
Dim pictBlocks As Integer
pictBlocks = fileSize / BLOCK_SIZE
Dim leftOverData As Long
leftOverData = fileSize Mod BLOCK_SIZE
Dim pictData() As Byte
ReDim pictData(leftOverData)
Get sourceFile, , pictData()
rsemployee.AddNew
rsemployee("Photo").AppendChunk pictData()
ReDim pictData(BLOCK_SIZE)
Dim i As Integer
For i = 1 To pictBlocks
Get sourceFile, , pictData()
rsemployee("Photo").AppendChunk pictData()
Next i
rsemployee.Fields("EmployeeID") = txt1.Text
rsemployee.Fields("EmployeeName") = txt2.Text
rsemployee.Fields("EmployeePosition") = txt3.Text
rsemployee.Fields("Address") = txt4.Text
rsemployee.Fields("Age") = txt5.Text
rsemployee.Fields("Gender") = txt6.Text
rsemployee.Fields("PhoneNo") = txt7.Text
rsemployee.Update
Close sourceFile
End If
plzzzzzzzzz help me ......................
Dim sourceFile As Integer
sourceFile = FreeFile
Open fileName For Binary Access Read As sourceFile
fileSize = LOF(sourceFile)
If fileSize = 0 Then
Close sourceFile
MsgBox "Employee's Photo is invalid"
Exit Sub
Else
Dim pictBlocks As Integer
pictBlocks = fileSize / BLOCK_SIZE
Dim leftOverData As Long
leftOverData = fileSize Mod BLOCK_SIZE
Dim pictData() As Byte
ReDim pictData(leftOverData)
Get sourceFile, , pictData()
rsemployee.AddNew
rsemployee("Photo").AppendChunk pictData()
ReDim pictData(BLOCK_SIZE)
Dim i As Integer
For i = 1 To pictBlocks
Get sourceFile, , pictData()
rsemployee("Photo").AppendChunk pictData()
Next i
rsemployee.Fields("EmployeeID") = txt1.Text
rsemployee.Fields("EmployeeName") = txt2.Text
rsemployee.Fields("EmployeePosition") = txt3.Text
rsemployee.Fields("Address") = txt4.Text
rsemployee.Fields("Age") = txt5.Text
rsemployee.Fields("Gender") = txt6.Text
rsemployee.Fields("PhoneNo") = txt7.Text
rsemployee.Update
Close sourceFile
End If
plzzzzzzzzz help me ......................
![]() |
Similar Threads
- Solution for Disabled Backgound in Display Properties (Viruses, Spyware and other Nasties)
- Dual display problems. (Monitors, Displays and Video Cards)
- Horizontal lines across display (Monitors, Displays and Video Cards)
- Blurred picture (Monitors, Displays and Video Cards)
- LCD- Partial Display, Black, Horizontal Line, Picture Shrunk (Monitors, Displays and Video Cards)
- windows media player cannot display chinese (Windows NT / 2000 / XP)
- screen problem with my laptop (Troubleshooting Dead Machines)
- Explorer Encoding (Web Browsers)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: passing data from one field from one form to another
- Next Thread: VB6 Pass Value from Dll to Exe
| 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 calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis 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 subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






