Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Import text file to access database via Excel VBA

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Import text file to access database via Excel VBA

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import from Excel to an access database using Jet in vb.net Andy HP[_2_] Excel Programming 1 December 14th 10 07:26 AM
Database query to import from Access to Excel David T Excel Discussion (Misc queries) 0 August 31st 06 07:12 PM
How to import multiple sheet of excel into Access database to a diffrent tables?? baka Excel Discussion (Misc queries) 0 July 6th 06 05:48 AM
Import to excel Access database directly to a variable (not using sheets) internacio Excel Programming 2 January 30th 06 02:03 PM
automatic import of .csv file into access database amolchopra Excel Programming 0 November 8th 05 09:32 PM


All times are GMT +1. The time now is 09:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"