Kamis, 29 Mei 2014

Re: [MS_AccessPros] Re: List of Attachements

 

If you want to move them to a network folder, you can do that and accomplish all those things you want. You have to way the pros and cons.  If you are at a gig already with only 72 documents, then I would think you need to move it.  

So you would make an attachments table that holds the file name. I normally do not save the whole path unless I am not centralizing the documents.  I save the folder location in a seperate table. That way if I move all of the files to a nother folder I just change the folder location.  When I want to retrieve the file, I concatenate the folder path and the file name.  So your attachment table looks something like

tblAttachments
  
AttachmentName
  AttachmentID
  AttachmentTimeStamp
  Parent_FK   ' foreing key to parent
  'any other fields

The way I normally do it is to have a File Picker and definately not type the name in.  So when I want to add an attachment I click a button and the file dialog opens. I select the file from its location, Rename it to include the AttachmentID, move or copy it from its location into my centralized folder. Then it would run an insert query to add the attachmentName, time stamp, parent, and any other data.  When I delete a record, I also delete the file from the centralized location.


So that you do not have to hand jam the existing ones, someone provided some code already to same attachments in the db to a folder and put the information in the table.  

So I may save the fileName as 234_SomeFileName.PDF  where 234 is the key of the related record.  In case anthing gets messed up I can rejoin manually.
So if I save the path to the folder in one place like : C:/MyDocuments/DatabaseFiles/
Then I can concatenate the two into
C:/MyDocuments/DatabaseFiles/234_SomeFileName.PDF

Finding code to do all of this is plentiful, but even so may be challenging if you are a novice.


On Thu, May 29, 2014 at 12:35 PM, ka0t1c_ang3l <no_reply@yahoogroups.com> wrote:
 

Thank you all for your help! 

 

Peter,

 

I did the compact and repair database as you recommended, and it did compact the database and brought it down to 1.01 GB; however, it's still large.  Instead of using the attachment field, could I just type in the name of the document, and have a hyperlink that would open the document from a network folder?  If so, how would I do that?  And, could I then add in a date/time field for each of those hyperlinks that would show the date the item was added?  And could I then have the list and timestamp added to my compliance report?

 

Thanks!!!


__._,_.___

Posted by: Peter Poppe <plpoppe@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (19)

.

__,_._,___

Tidak ada komentar:

Posting Komentar