Import Excel data range into Access Database using a SQL Query.

mcAvero

New Member
Joined
Jun 24, 2020
Messages
6
Office Version
  1. 2010
Platform
  1. Windows
Hi there I have used the the following SQL Query in Access to the following range (A5 to T1000) from Excel, to be placed into a Table in Access with Headers.

SELECT * INTO [Ref_Tracker_File]
FROM [Excel 8.0;HDR=Yes;database=\\mark\access\Program\Tracker\Orders\Tracker 2020.xlsm].[Tracker$A5:T1000];

I used this code a few year ago, now only get the following error:
"The connection for viewing your linked Microsoft Excel file was lost."

Thoughts or other SQL alternatives ?
 

Attachments

  • 1596215338415.png
    1596215338415.png
    12.5 KB · Views: 42

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
You can still do it using Linked tables.
The key is to use named ranges in Excel. Just start the named range on row 4. Then when you are linking the data in Access, you can select the named range.
 
Upvote 0
would agree, though I have 10 excel files from different teammates, which the code above above allowed me to bring in a selected data range.
 
Upvote 0
Well, you asked for thoughts, and that was mine.
If it were me, I would probably look to do one of the following:
1. See if the entire process can be done in Access, and get rid of the Excel part
- or -
2. Run an Excel macro that first deletes the first 4 rows of data, so the header is one row 1, before importing.
 
Upvote 0

Forum statistics

Threads
1,214,624
Messages
6,120,591
Members
448,973
Latest member
ksonnia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top