Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Exporting excel worksheet to access table

"Narwe" wrote ...

I have an excel worksheet with defined columns that i need to export to a
access database with identical column headings. I can get as far as
importing my worksheet into a dataset, but im not really sure where to go
from there.


Don't use a Dataset. Instead use OleDb, the Jet 4.0 OLEDB provider and
Jet's INSERT INTO..SELECT syntax e.g.

INSERT INTO
[Database=C:\MyJetDB.mdb;].MyTable
(MyTextCol, MyIntCol)
SELECT
MyCol1 AS MyTextCol,
MyCol2 AS MyIntCol
FROM
[Excel 8.0;HDR=YES;Database=C:\MyWorkbook.xls;].[MyWorksheet$]
WHERE
MyCol2 55
;

If you establish a connection to either the DB or spreadsheet you can
omit the corresponding connection string in the query.

Jamie.

--
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting data to Excel pivot table from Access Pat Dools Excel Discussion (Misc queries) 3 October 22nd 08 06:49 PM
excel worksheet export into access table H. Chudhary Excel Worksheet Functions 0 January 23rd 08 02:26 PM
exporting worksheet to access Judy Margo Excel Discussion (Misc queries) 2 November 27th 06 04:49 PM
Link Access table to Excel worksheet dalesrunner Excel Discussion (Misc queries) 1 March 28th 05 12:09 AM
Exporting excel worksheet to access table Tom Ogilvy Excel Programming 0 September 21st 04 05:03 PM


All times are GMT +1. The time now is 01:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"