Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

Sql query for importing .doc files in a table

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
Qw M
Asked:
Qw M
  • 2
1 Solution
 
Surone1Commented:
On Error Resume Next

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

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


myfl = Dir

Loop
0
 
Qw MAuthor Commented:
I also need the code <the insert into database part>. The database name is test.mdb. Thank you!
0
 
Surone1Commented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now