PC Review


Reply
Thread Tools Rate Thread

Import text file to access database via Excel VBA

 
 
Dan
Guest
Posts: n/a
 
      21st Apr 2009
Is it possible to import a text file into an access database via Excel.
The Access Table that the file should be imported already exist - it just
should be emptied of data and populated by the new data from the text file.
Thank you
Dan
 
Reply With Quote
 
 
 
 
joel
Guest
Posts: n/a
 
      21st Apr 2009
You neede a macro to write to an Access Database from Excel. You can import
data directly in Access from a file witout using Excel. You can query a
Database from excel without a macro.

there are different methods that can read/write to access using a macro
depending the version of access that was used to create the database. The
two main ways of access the database is using the ADO or DAO methods.

I usually refer to the Access VBA help menu along with a book I bought.
when access the database from excel I create an Access Application and then
use ACCESS methods to read and write the data. You also need to add refernce
libraries to the excel vba (tools - references)

Add the following references
Microsoft Access 11.0 object library (or latest version)
Microsoft ActiveX data ojects 2.8 library (for ADO method, use latestt
library)

Creating and Access object in excel vba

Set obj = createobject("Access.Application")

or open an existing database

set db = GetObject("c:\temp\dbase1.mdb")



"Dan" wrote:

> Is it possible to import a text file into an access database via Excel.
> The Access Table that the file should be imported already exist - it just
> should be emptied of data and populated by the new data from the text file.
> Thank you
> Dan

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import text file to access database via Excel VBA. Dan Microsoft Access VBA Modules 1 21st Apr 2009 04:33 PM
Import Text file via browse box - import specs? Diane, St. Louis Microsoft Access Form Coding 3 14th Jan 2009 07:53 PM
How can I import to Access 2003 from csv-file via VBA? hanski Microsoft Access Forms 4 10th Jul 2008 01:51 PM
Import query from access into excel via vba, but will not refresh newyears Microsoft Excel Programming 0 4th May 2008 06:58 AM
Import VBA Code in Excel-File ? (Export VBA Code to file) Matthias Pospiech Microsoft Excel Programming 2 22nd Mar 2005 05:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:57 PM.