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: 47

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
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,223,275
Messages
6,171,123
Members
452,381
Latest member
Nova88

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