troubleshooting Question

MS Access - Selective Column Import From Excel

Avatar of keschuster
keschuster asked on
Microsoft Access
3 Comments1 Solution1070 ViewsLast Modified:
I'm curious if anyone has done this or knows how to go about doing it.  I need to bring Excel data into Access.  The files will be in varying layouts.  We're thinking about editing each spreadsheet header to selectively choose which columns get imported.  Each spreadsheet may have 5 columns or 100.  By analysis we can determine which fields should be imported and into what fields.  We are thinking of editing the header with specific names like _AssetID, _Location, and _Cost.  From Access I want to read the excel files header and "discover" these specific header names then only import those columns.

My thought was to dynamically generate a SQL statement based on the header name then import....

The final query might look like
INSERT INTO Table1 ( assetID, location, cost)
SELECT _AssetID, _Location,_Cost
FROM ExcelSpreadsheet

I'm not sure how to go about this...

I should also note that at some point we may want to use SQL server to store this data - potentially through access...  I'm hoping the groundwork I lay here in Access will at least establish a process for moving this to sql server.

Right now - I just need to get this data into Access

thoughts?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros