Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2008
    Posts
    25

    Unanswered: Need to link files to DB with Access 2003

    Hello,

    I want to 'attach' images to my 2003 DB, and after doing a bit of research am thinking its best to just link to image files that will be stored in a network folder. (This is because I want the DB to be able to grow beyond the 2GB limit of Access DBs....)

    Assuming this is the case, I'd like some help in setting up my form so the user can:

    1) Browse to the image file
    2) Hit an 'Attach' button which then saves the image file in a specific folder (where all images are stored)
    3) Save the image file with the proper naming convention (which happens behind the scenes) so that the image has an ID and can be queried as desired
    4) Display the image at the bottom of the form (I realize there will need to be a limitation on the image dimension)- not sure if this one is possible!

    Let me know if this makes sense.
    thanks very much!

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Makes sense to me.

    Where are you stuck?

    1) I use Windows APIs for that, but there is an easier way... I just can't remember where I saw it.

    2) That will come down to the code that calls the OpenFile dialog.

    3) That will come down to the code that calls the OpenFile dialog.

    4) It's possible, you just update an Image object on your form with the path to the file in your OnCurrent event procedure.

    If I find the example I have of the simpler method, I'll post it here, but it might take a while, I have hundreds of databases.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Ha, you're lucky, I remember I made a text file out of this one for easy finding

    I haz pr0 filing skillz

    Code:
        Dim fdSaveAs As FileDialog
        Dim strFileName As String
         
        Set fdSaveAs = Application.FileDialog(msoFileDialogFilePicker)
    
        With fdSaveAs
            .AllowMultiSelect = False
            .InitialView = msoFileDialogViewDetails
            .Filters.Add "Please select a CSV File", "*.csv"
            .InitialFileName = "F:\Database Projects\Production Database\"
            If .Show = -1 Then
                strFileName = .SelectedItems(1)
            Else
                Exit Sub
            End If
        End With
    
        MsgBox strFileName
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •