access scripts trasfer embeded pdfs

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
yasanthaxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
yasanthaxAuthor Commented:
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
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

yasanthaxAuthor Commented:
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
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
yasanthaxAuthor Commented:
It is in a table in access in a field with datatype=attachment. sorry I have not come across theis before
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yasanthaxAuthor Commented:
thanks this works.  One note need to "set rsAttach"
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.