Save Attachments to the Database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gazelle04
    New Member
    • Jul 2006
    • 52

    Save Attachments to the Database

    I want to save a file for a data in a Database. I'm working on a Schools Database and I want to have a command button that says "Attachment s" for a particular "School". Attachments may vary from Word documents, PDF file, Excel files or Html file.

    I'm thinking of using the Common Dialog controls in Access but I still don't know how to use them. Can anyone send me the code.
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Hi,

    Do you want to Save those attachements in the database or not? I understand that You would like to do this.

    In this case our Access database will grow very fast espesially if your documents are big files! I have one database in which I store only bitmaps, one table with bitmaps... And it's very heavy database! I've done it because I want to visualize my bitmaps in my reports using the OLE control... This is the only reason. If I wanted only to open them I'll store them in a special folder and I'll conserve in the database only the path or other specifications of those files...

    To have such different objects in your database may slow down everything! Be carefull

    Have a nice day!

    Comment

    • gazelle04
      New Member
      • Jul 2006
      • 52

      #3
      I do not want it to be saved or attached to the database file, I wanted it to be saved in another folder or in the same location as the .mdb file. Yes, you're right the database would become too big if it is saved in the database file as a data in a table. I only want to save the link to the file, the file could be anything like word document, jpg files, excel files, or html files.

      Comment

      • PEB
        Recognized Expert Top Contributor
        • Aug 2006
        • 1418

        #4
        Reelly I've never saved hyperlinks in the database but it is very interesting to do it... It's very interesting and usefull!

        I'm also searching how to do it... The results I'll post here...

        For the moment I've seen:

        Hyperlink Text or combinations of text and numbers stored as text and used as a hyperlink address. A hyperlink address can have up to three parts:
        text to display — the text that appears in a field or control.

        address — the path to a file (UNC path) or page (URL).

        subaddress — a location within the file or page.

        screentip — the text displayed as a tooltip.

        The easiest way to insert a hyperlink address in a field or control is to click Hyperlink on the Insert menu.
        Each part of the three parts of a Hyperlink data type can contain up to 2048 characters

        Comment

        • PEB
          Recognized Expert Top Contributor
          • Aug 2006
          • 1418

          #5
          If you don't want to insert the hyperlinks programatically you can use the command in Access that does it!

          If not I'll continue to search for programatically ways to do it!

          Comment

          • PEB
            Recognized Expert Top Contributor
            • Aug 2006
            • 1418

            #6
            OOOUUAUU!!!!
            When you create a field of type Hyperlink every text entered manually is considered as hyperlink!

            When you enter D:\ it opens Explorer and D Drive
            When you enter D:\temp1.xls it opens Excel with the suitable file!

            And about the 3 parts of the hyperlink:
            hyperlink only with 1 part in mode edition:
            #D:\Temp1.xls#
            hyperlink with 2-3 parts in mode edition:
            google.com#http ://google.com#
            D:\TEMP.XLS#D:\ TEMP.XLS##happy birthday to you

            AND usually in your field you have the first part of the hyperlink! If you want to treat the hyperlink with string functions only the first part can be treated using queries! Using code it's a bit different! :)

            But this is a very good way to work with documents concerning the respective record :)

            Comment

            Working...