How to import data from Access into a Current Worksheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello Everyone
I m not sure if this is the right place for my query?
I am a studrnt and I am doing an assignment in which I have to import data
into Excel worksheet.Now this data needs to be appended to the existing data.
The problem is that Data that i am importing is only 10 fields and the
worksheet has 19 fields. I tried using the import wizard but it just pastes
the data on the worksheet,not in the proper fields or cells.
How can I import data into its specific fields?
Also My Insert Query does not work with excel?
It works fine with Access?
Please help me or direct me to the right group.
Ankit Parikh
 
Ankit said:
I am a studrnt and I am doing an assignment in which I have to import data
into Excel worksheet.Now this data needs to be appended to the existing data.
The problem is that Data that i am importing is only 10 fields and the
worksheet has 19 fields.

Here's a basic SQL DML 'template' for you to research further:

INSERT INTO
[Excel 8.0;HDR=YES;Database=C:\MyWorkbook.xls;].[MySheet$]
(xl_col1, xl_col2)
SELECT MyCol1 as xl_col1, MyCol2 as xl_col2
FROM
[MS Access;Database=C:\MyJetDB.mdb;].[MyTable];

Jamie.

--
 
Back
Top