infoCopter

home | newsletter | site map
Free Stuff
: links
: downloads
: Neue Surf Tips
: know-how
: Zitate
: HTML Checker



Activities
--in spare time

: vorträge



About IC
: friends
: lust und frust
: guestbook
: what's new

MS Access Automated Data Import


See also Forum
Printable VersionPrinter-friendly

Questions would match this topic:

  1. code to import relationships or other external data
  2. import data from Excel or flat file in batch mode into a MS Access database


Help! Assume this must be a common task! We want to import new data from Excel or flat file input in batch mode into a MS Access database. Have anybody some code available?

Thanks!! --Reto


something like that (doesn't work yet ;-)

Option Compare Database
Option Explicit

Dim nWindEx As Database, tDef As TableDef
Dim dataSource As String

dataSource = "Excel 97;DATABASE=C:\temp\import.xls"
    
Set nWindEx = Workspaces(0).OpenDatabase(Application.Path _
    & "\NWINDEX.MDB")
    
Set tDef = nWindEx.CreateTableDef("Product")
tDef.Connect = dataSource
tDef.SourceTableName = "Product"
nWindEx.TableDefs.Append tDef

nWindEx.Close

What I found out till now
  1. MS Access Help
  2. Sample Code from Microsoft

[Blue Ribbon Campaign icon]
Join the Blue Ribbon Online Free Speech Campaign!

©1998-2002 infoCopter