View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default Database link to worksheet!

Kim-Anh Tran wrote ...

I am using MS
Access 2000. I need to clarify that I only need to create a workbook
using the personal data from database once. Once I have the worksheet
for the individual, we do update on this worksheet.


Deferring to my earlier, you can do this in a query. In MS Access,
open a query object, go the SQL view, paste in the following queries
and amend the details (columns, tables, workbook path etc) to suit
your situation.

To update an existing Excel table:

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
;

To create a new Excel workbook/worksheet/table:

SELECT
ColA AS MyCol1,
ColB AS MyCol2,
ColC AS MyCol3
INTO
[Excel 8.0;database=C:\NewWorkbook.xls;].Sheet1
FROM
MyTable
;

Jamie.

--