Solved

Sql query for importing .doc files in a table

Posted on 2009-07-16
3
177 Views
Last Modified: 2012-05-07
Hi!
I need a sql query or a VBA code (I work in Acess) to read all the .doc files from a folder, when I click a button. I have a folder (c:\docs) and in this folder I have .doc files. I also have a table ( table1) with filds ID, document (type: OLE Object). I want a sql query or a vba code to read all the documents name from the folder and then import all the document in the table.

Thank you!
0
Comment
Question by:Qw M
  • 2
3 Comments
 
LVL 13

Expert Comment

by:Surone1
ID: 24869249
On Error Resume Next

myfl = Dir("C:\docs\*.doc")

Do While myfl <> ""
docfile =  "C:\docs\" & myfl
<insert into database part>


myfl = Dir

Loop
0
 

Author Comment

by:Qw M
ID: 24869282
I also need the code <the insert into database part>. The database name is test.mdb. Thank you!
0
 
LVL 13

Accepted Solution

by:
Surone1 earned 500 total points
ID: 24869421
i'm sorry, i dont know that part, but i did find this post http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Coding-Macros/Q_22640360.html which discourages adding doc files like that..
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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…

707 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

13 Experts available now in Live!

Get 1:1 Help Now