Solved

access scripts trasfer embeded pdfs

Posted on 2014-09-09
8
122 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
 

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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS accesss using VBA to change a default value 5 30
Cross Tab with two column values 7 38
how to link subforms ms/access VBA 6 30
Export Query data to excel file 14 38
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views 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 Microsoft Access…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

862 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now