Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > blob saving mystery


Reply
 
Thread Tools Display Modes
  #1  
Old 06-02-2004, 08:07 AM
f3rDzReYeS f3rDzReYeS is offline
Regular
 
Join Date: May 2004
Posts: 59
Default blob saving mystery


How come there are instances wherein the jpg's blob file are saved in the Photo field and there are time's its not?

Code:
Private Sub cmdTWAIN_Click() 'create a temporary file acquired from a webcam frmAcquireImage.Show vbModal, Me 'load the temporary file n image1 Image1.Picture = LoadPicture("c:\fjrtemp.jpg") 'append image file to database FileToBlob Adodc1.Recordset.Fields("Photo"), "c:\fjrtemp.jpg" End Sub

the filetoblob function came from this thread:
http://www.xtremevbtalk.com/showthread.php?t=26291

appreciate any help

ferdz
Reply With Quote
  #2  
Old 06-02-2004, 09:05 AM
Dennis DVR's Avatar
Dennis DVR Dennis DVR is offline
Back in the Game

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Manila Philippines
Posts: 3,555
Default

try this

Code:
Function ProcessImage(strImageName) As Byte() Dim IntNum As Integer Dim ByteImage() As Byte If (strImageName <> "") Then IntNum = FreeFile Open strImageName For Binary As #IntNum ReDim ByteImage(FileLen(strImageName)) Get #IntNum, , ByteImage Close #1 End If ProcessImage = ByteImage End Function
to save the image to your table
Code:
rs.Fields("myImage").AppendChunk ProcessImage("c:\fjrtemp.jpg")

But saving the image to your table will rapidly increase the size of your Database so i won't recommend using this method save the path and name of the image file as much as you can.
__________________
Avatar by Lebb

[Posting Guidelines] [Standards & Practices Tutorial] [Participate here effectively]
Our knowledge can only be finite, while our ignorance must necessarily be infinite. Karl Popper
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->