Import Excel in Access

S

sosteffo

How do i import an excel spreadsheet into access....i can't fin
anyway...i can dot he opposite do this must be possible!!!!
 
E

Earl Kiosterud

Sosteffo,

In Access, File - Get External Data. Choose either link or import. Change
the file type box (bottom) to xls, and navigate to the folder containing the
workbook.
 
D

DDM

Sosteffo, first make sure your Excel spreadsheet is properly set up, with
the data entered into contiguous columns and rows, and with column headings
(which will become field names) in Row 1.

In Access, open a database file and File > Get External Data > Import. In
the Import dialog box, set Files of type to "Microsoft Excel" and navigate
to your Excel workbook file. Select it and click Import to launch the Import
Spreadsheet Wizard. Then follow the prompts.
 
S

sosteffo

the database already exsists, and i cant afford to lose ay of the dat
in there.....does this add (or) replace the data in there????

Tn
 
O

onedaywhen

sosteffo wrote ...

I recommend an INSERT INTO..SELECT query. From the MS Access side, it
would look something like this:

INSERT INTO MyJetTable
(Col1, Col2)
SELECT MyColA AS Col1, MyColB AS Col2
FROM [Excel 8.0;database=C:\MyWorkbook.xls;].[MySheet$]

You can first try the SELECT query on its own (i.e. without the INSERT
INTO clause) to find out how many rows will be inserted.

--
 
D

DDM

Sosteffo, it adds to (Access calls it "appends"); it does not replace.

The Import Spreadsheet Wizard in Access gives you the option of pulling the
data into a new table or appending it to an existing one. If you choose to
append, Access will add the data to the bottom of the table. It will not
replace any of the data already there.
 
O

onedaywhen

...
it adds to (Access calls it "appends")

SQL, the universal language of data access (small 'a'), calls it
INSERT INTO.
Access will add the data to the bottom of the table.

That is technically correct, but why get technical? I assume you are
alluding to the fact that MS Jet tables are physically ordered on the
clustered index, which is always the primary key column/field in Jet,
but physical re-ordering doesn't actually occur until the database
file is compacted, so effectively the new rows/records get added to
the 'bottom' of the table.

It is better IMHO to consider tables as sets i.e. without physical
ordering (and no bottoms!), therefore INSERT is a better description.
This is the idea behind SQL i.e. you don't get involved with the
physical implementation on the DBMS, although for performance reasons
it pays to have some regard to certain 'features' e.g. the
aforementioned fact that you get no choice over the clustered index in
Jet so it's worth knowing that the commonly used INDENTITY/autonumber
function makes for a lousy primary key!

--
 
Top