Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

photo archive in access

Status
Not open for further replies.

dumdum2

Programmer
Mar 18, 2000
98
GB
I'm wondering if anyone has any experience in setting up a photo archive in Access 2000? And if so, do you have any suggestions??

Thanks!
 
I've tried to embed files in Access--don't.

My preferred method is to store the files in a specific directory and store the full path\filename in the database.

There are of course, exceptions, but the general rule is "just don't".
 
Yeah....take pseale's advice. Take a look at this thread702-289543
It works great I've used if for forms and reports.
 
I created a Parts Catalogue database for a company to store pictures of the different parts they use. What you shouldn't use is the lame example in the Northwind database of embedding pictures (you know, where they show the employee pictures). Why? Because it bloats the database like crazy! A 50K JPG increases the database size by 500K or so.

You have to write your own code to copy the binary data to an OLE DB field, using the GetChunk and AppendChunk methods of an ADO recordset object. There is more coding on your part, but the database only grows by the size of the actual picture.

Unfortunately I can't show you my code because the database is currently on a hard drive that's sitting on my shelf. However, I googled up a Microsoft article that shows the technique:

 
Here is a function to show picture on Image Control on form
Pictures must be in the same folder.
Code:
Private Sub Form_Current()
    'dim variables
    Dim folderpath, ImageName
    
    'find folder path
    folderpath = CurrentProject.Path
    
    'set image name with extension
    ImageName = Me.txtImageName.Value
    
    'capture new record error
    If Me.NewRecord Then
        Exit Sub
    Else
        'set picture to the image
        If Dir(folderpath & "\" & ImageName) = ImageName Then
        Me.Image6.Picture = folderpath & "\" & ImageName
        Else
        'set a nopicture image
        Me.Image6.Picture = folderpath & "\" & "NoPicture.jpg"
        End If
    End If
End Sub

________________________________________________________
Zameer Abdulla
Help to find Missing people
Even a thief takes ten years to learn his trade.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top