G
Guest
Good afternoon everyone. I need help scripting a small snipet of code for an
Access DB. I need to take info from a a table and put it into an Excel file.
I found this in the forums and I am trying to adapt it for my needs. Here is
the script.
INSERT INTO
[Excel 8.0;database=C:\MyWorkbook.xls;].MyBookLevelName
(MyCol1, MyCol2, MyCol3)
SELECT
ColA AS MyCol1,
ColB AS MyCol2,
ColC AS MyCol3
FROM
MyTable
What I think I need to do:
1. Change .MyBookLevelName to .Temp (assuming the workbook name is Temp)
2. Change ColA, ColB, ColC to the field names in the table.
3. Change MyTable to the name of the Access table I want to export from.
So it should look like:
INSERT INTO
[Excel 8.0;database=C:\addresses.xls;].Temp
(First_Name, Last_Name, Zip_Code)
SELECT
First_Name AS MyCol1,
Last_Name AS MyCol2,
Zip_Code AS MyCol3
FROM
Address
Thanks for the help. I really need to take a VB course.
Access DB. I need to take info from a a table and put it into an Excel file.
I found this in the forums and I am trying to adapt it for my needs. Here is
the script.
INSERT INTO
[Excel 8.0;database=C:\MyWorkbook.xls;].MyBookLevelName
(MyCol1, MyCol2, MyCol3)
SELECT
ColA AS MyCol1,
ColB AS MyCol2,
ColC AS MyCol3
FROM
MyTable
What I think I need to do:
1. Change .MyBookLevelName to .Temp (assuming the workbook name is Temp)
2. Change ColA, ColB, ColC to the field names in the table.
3. Change MyTable to the name of the Access table I want to export from.
So it should look like:
INSERT INTO
[Excel 8.0;database=C:\addresses.xls;].Temp
(First_Name, Last_Name, Zip_Code)
SELECT
First_Name AS MyCol1,
Last_Name AS MyCol2,
Zip_Code AS MyCol3
FROM
Address
Thanks for the help. I really need to take a VB course.