[AccessD] Linking to an excel spreadsheet

Gustav Brock Gustav at cactus.dk
Mon Nov 22 12:21:28 CST 2004


Hi John

Are you looking at the xls file as a database? It doesn't seem to be
the case.
The database has tables - worksheets or Named Ranges - it is those that
are to be linked.

/gustav

>>> JColby at dispec.com 22-11-2004 18:52:47 >>>
Does anyone have code for linking to an excel spreadsheet?

If I manually create a link, the wizard finds all the fields, sets up
with
the "first line has field names" etc.  Everything works fine.  However
if
the table is not linked already, I need to create a tabledef, set the
SourceTableName and Connect properties.  If I then try to append the
tabledef to db.tabledefs I get an error that no fields are defined.  It
is
obvious that a LOT more is involved here.  It appears that I have to
open
the spreadsheet, get the first line, create fields with the data in
the
first line, somehow figure out the datatype of each column etc.  Is
there a
prebuilt code I can call to do all this stuff?  If the wizard can do
it,
then the code behind the wizard could do it for me.

Has anyone ever done this?

John W. Colby
The DIS Database Guy

-- 




More information about the AccessD mailing list