Solved

access scripts trasfer embeded pdfs

Posted on 2014-09-09
8
123 Views
Last Modified: 2014-09-16
Hi

Can anyone please help me with some script/code where I can read embeded pdf records by structure and map each record to a new folder at record level abd save pdf documents to respective folder.  This is for a tactical fix before this is incorporated into Shared Point.

I need tp remove 500 records to folders and respective attachmnets saved in the folders.
essentially read folder and pdfs, create folders for each record and paste attached documents under corespondng folder
0
Comment
Question by:yasanthax
  • 4
  • 4
8 Comments
 
LVL 84
ID: 40314181
Note sure what you mean by "read embeded pdf records by structure". Do you mean you have embedded PDF documents in an Access form?

Or are you using the new Attachment field to store these items?
0
 

Author Comment

by:yasanthax
ID: 40314479
yes , embeded pdfs in an access form. So wondering if record name can be put into a directory, then the documentsaved under this folder
0
 
LVL 84
ID: 40315274
How did you embed them? If you can locate the actual item name of the item, you can always use the FileCopy command:

FileCopy "source", "Destination"
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:yasanthax
ID: 40316473
Hi

I inherited a database with pdfs that have been uploaded into it. I have now split the database to Frontend and Backend as they need this for multiple users and now trying to de attach the pdfs and put them into outside folders that can be hyperlinked back from the database.
0
 
LVL 84
ID: 40316736
Okay ... but HOW are they embedded? Are they stored in an OLE field, or an Attachment field? You'd have to give us more information before we could help further.
0
 

Author Comment

by:yasanthax
ID: 40317314
It is in a table in access in a field with datatype=attachment. sorry I have not come across theis before
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40317534
Okay ... so you've got one of the new Attachment fields, and you need to dump the contents to disc.

Here's some code based on http://msdn.microsoft.com/en-us/library/office/ff835669(v=office.15).aspx:

Dim db as DAO.Database
Set db = CurrentDB

Dim rst As DAO.Recordset
Set rst = db.OpenRecordset("SELECT * FROM SomeTable")
  
   … Code to move to desired employee 
Dim rsAttach As DAO.Recordset
rsAttach = rst.Fields("YourAttachmentField").Value

Do Until rsAttach.EOF
  rsAttach.Fields("FileData").SaveToFile "C:\SomeFolder"
  rsAttach.MoveNext
Loop

Open in new window

Note you'd need to change Table and Field names EXCEPT for the "FileData" field in the rsAttach recordset. That FieldName should stay the same ....
0
 

Author Closing Comment

by:yasanthax
ID: 40325575
thanks this works.  One note need to "set rsAttach"
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question