Questions would match this topic:
- code to import relationships or other external data
- 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
- MS Access Help
- Sample Code from Microsoft