Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2007

Tip: Looking for answers? Try searching our database.

export CSV file to Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
muyBN - 05 Jun 2007 23:23 GMT
I have a CSV file that I want to export into Access. I Know that I can use an
object command in a Word macro to use Access' import wizard, but I prefer
using a SQL statement to do it, mainly because I don't want to put my user
through the steps of the wizard. Is there any way that I can use a SQL
statement to import the whole CSV file?

Signature

Bryan

Cindy M. - 09 Jun 2007 14:53 GMT
Hi =?Utf-8?B?bXV5Qk4=?=,

> I have a CSV file that I want to export into Access. I Know that I can use an
> object command in a Word macro to use Access' import wizard, but I prefer
> using a SQL statement to do it, mainly because I don't want to put my user
> through the steps of the wizard. Is there any way that I can use a SQL
> statement to import the whole CSV file?

Nothing native to Word. You can link in the Jet Engine's DAO object library or
use ADO/OLE DB to write the information directly into the Access database, just
as you'd do in Access or using Excel, or any other programming language.

Probably best to pursue the details in a newsgroup that handles the connection
method you choose (Access for DAO, data.ado newsgroup for ADO). To link in one
of those libraries into a Word macro, go over Tools/References and select the
one you want from the list.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
Bryan - 10 Jun 2007 05:10 GMT
After much digging, as you suggested, I came up with this workable model:

   strSQL = "INSERT INTO [" & strTable & "] " & _
           "SELECT * " & _
           "FROM [Text;HDR=YES;DATABASE=" & strPath & ";].[" & strFile & "]"

Thanks for your assistance.

Signature

Bryan

> Hi =?Utf-8?B?bXV5Qk4=?=,
>
[quoted text clipped - 20 lines]
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.