Solved

Sql query for importing .doc files in a table

Posted on 2009-07-16
3
178 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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.

863 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

28 Experts available now in Live!

Get 1:1 Help Now