I use external data in Excel from access via the Access ODBC Driver. When the source database is relocated, Excel cannot find the database anymore as it stores the absolute path. Changing the ODBC source doesn’t help therefore.
Is the a workaround? Has this behaviour changed in Office XP?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Excel external data from access (Access 97/ Excel 97)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Excel external data from access (Access 97/ Excel 97)
- This topic has 22 replies, 5 voices, and was last updated 23 years, 1 month ago.
AuthorTopicWShschwickart
AskWoody LoungerSeptember 4, 2001 at 7:11 am #359813Viewing 1 reply threadAuthorReplies-
WShschwickart
AskWoody Lounger -
WSralphad
AskWoody LoungerSeptember 4, 2001 at 12:13 pm #540509If you move the database, then how should ODBC know where you’ve moved it to? Perhaps you moved it to a floppy disk drive, and then what good does it do if it somehow follows it?
If you’ve got machines which are relying on your database to retrieve data, then you will have to live with the fact that that database must not move or change name, otherwise those machines will not be able to use it anymore.
The ‘workaround’ would be to NOT move the source database!
-
WShschwickart
AskWoody LoungerSeptember 4, 2001 at 12:45 pm #540516ODBC knows because I told it where the database has gone to. But Excel/MSQuery don’t care. Of course I know that no one can access my database if I wear it in my pocket on a floppy. The reason is that I want to give the entire package of combined Excel & Access files to a collegue who doesn’t want to construct exactly the same file structure I have got. Also if you develop somtehing on your local drive and want to place it on a network drive you will get the same problem
-
WScharlotte
AskWoody LoungerSeptember 4, 2001 at 1:13 pm #540522I’m not clear on the problem you’re having. Are you trying to query Access from Excel using existing saved MS Queries? In that case, it will not adapt itself to a different location for the database. Are you doing this from code, for the MS Query grid or what?
You can’t expect it to adapt itself to an entirely different file structure without any human intervention.
-
WShschwickart
AskWoody LoungerSeptember 4, 2001 at 2:00 pm #540531The queries are not saved externally, but stored in the Excel sheet. The normal behaviour I would expect, is that EXCEL/MSQUERY look into ODBC to get the location of the access database, but they do only the first time, when the query is set-up, the they use the absolute path from the first setting in the ODBC source. The human intervantion was that after moving the database I changed the ODBC source according to the new location.
-
-
-
WSralphad
AskWoody Lounger -
WShschwickart
AskWoody Lounger -
WSralphad
AskWoody Lounger -
WScharlotte
AskWoody LoungerSeptember 6, 2001 at 1:38 pm #540978It is not a bug. That is, and has always been, normal behavior since the path is hard coded into the query. You can get around it somewhat in Office 2000 by using a Microsoft DataLink (udl) to hold the link to the data source. Then you just point at the datalink, which can be in the same folder as the spreadsheet, and let it find the data source.
-
WSralphad
AskWoody LoungerSeptember 13, 2001 at 12:13 pm #542253ODBC is supposed to abstract data storages and their locations into simple, commonly accessible Datasources, referenced by their DSN in the local ODBC configuration. If you should move the datasource and change the ODBC entry accordingly, the client application of that DSN should not notice, or indeed, care that the underlying datasource has been moved. I’m still of the opinion that this it is a bug in MSQuery in that it reads the underlying path and remembers it. Or, if it is indeed by design, I deem this to be very bad design.
-
WScharlotte
AskWoody Lounger -
WSralphad
AskWoody Lounger -
WSTearsInTheRain
AskWoody LoungerSeptember 26, 2001 at 12:45 pm #544142I recorded a macro whist using ‘GET EXTERNAL DATA’ to get data from an Access database. I now run the macro & just ignore the MS Query. Don’t know if this is a viable workaround, but here is the code (I don’t know how much of this is extraneous rubbish):
With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
“ODBC;DSN=MS Access Database;DBQ=P:INFOTECUK_CSSYS3MAR_ADDMarine Accrual.mdb;DefaultDir=P:INFOTECUK_CSSYS3MAR_ADD;DriverId=2” _
), Array(“5;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;”)), Destination:= _
Range(“A6”))
.CommandText = Array( _
“SELECT MarData.LOSS_ID, MarData.LOSSNAME, MarData.CAT_CODE, MarData.PAID_GBP, MarData.PAID_USD, MarData.PAID_CAD, MarData.OSLR_GBP, MarData.OSLR_USD, MarData.OSLR_CAD, MarData.PAID_cSTG, MarData.INC_c” _
, _
“STG” & Chr(13) & “” & Chr(10) & “FROM `P:INFOTECUK_CSSYS3MAR_ADDMarine Accrual`.MarData MarData” & Chr(13) & “” & Chr(10) & “ORDER BY MarData.LOSS_ID” _
)
.Name = “Import Marine FGU”
.FieldNames = False
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With -
WScharlotte
AskWoody Lounger -
WSralphad
AskWoody LoungerSeptember 26, 2001 at 1:04 pm #544156 -
WScharlotte
AskWoody Lounger -
WSralphad
AskWoody LoungerSeptember 26, 2001 at 1:42 pm #544163let’s look at the facts…..
1. you set up an MSquery (in excel or whatever)
2. you point it to a DSN, because you want the physical location to be abstracted from the application, i.e. you only want your application to know abuot the ‘MYDB’ DSN and not care where the underlying DB is (this is one of the reasons ODBC was invented)
3. you run your app happily
4. you move your underlying mdb and you change the DSN accordingly, so the DB move is transparent to the app
5. the app breaks because the stupid thing has gone and read the underlying path from the DSN, hardcoded it into itself and forgotten abuot the DSN completely!that does not look like expected behaviour to me….
-
WSashcroal
AskWoody LoungerSeptember 26, 2001 at 1:47 pm #544171 -
WScharlotte
AskWoody Lounger -
WSralphad
AskWoody Lounger -
WShschwickart
AskWoody LoungerFebruary 22, 2002 at 9:54 am #571884Hi,
I haven’t looked at this matter for along time because I was sick of it. Adam is exactly right and its not an Access Problem, but an Excel Problem. Its still appearent in Office XP. It did some investigatation:
When you save the Query and remove the “DSN” enty containing the path, the the path is reretrived from the ODBC but subsequently stored in the Excel Query.
I don’t know why Charlotte is defending Big Brother so enthusiastically, but this is what I call a bug. And they know about it, as in the according help files they describe that you have to maintain the absolute Path.
It was always easier to change the specs than to fix the errors. -
WScharlotte
AskWoody Lounger
-
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
W11 24H2 – Susan Bradley
by
G Pickerell
2 hours, 5 minutes ago -
7 tips to get the most out of Windows 11
by
Alex5723
4 hours, 12 minutes ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
42 minutes ago -
I installed Windows 11 24H2
by
Will Fastie
2 hours, 16 minutes ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
1 minute ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
51 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
8 hours, 16 minutes ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
9 hours, 37 minutes ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
20 hours, 57 minutes ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
1 day, 1 hour ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
1 day, 9 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
12 hours, 8 minutes ago -
Mail from certain domains not delivered to my outlook.com address
by
pumphouse
18 hours, 17 minutes ago -
Is data that is in OneDrive also taking up space on my computer?
by
WShollis1818
1 day, 4 hours ago -
Nvidia just fixed an AMD Linux bug
by
Alex5723
2 days, 20 hours ago -
50 years and counting
by
Susan Bradley
11 hours, 16 minutes ago -
Fix Bluetooth Device Failed to Delete in Windows Settings
by
Drcard:))
2 days, 3 hours ago -
Licensing and pricing updates for on-premises server products coming July 2025
by
Alex5723
3 days, 7 hours ago -
Edge : Deprecating window.external.getHostEnvironmentValue()
by
Alex5723
3 days, 7 hours ago -
Rethinking Extension Data Consent: Clarity, Consistency, and Control
by
Alex5723
3 days, 7 hours ago -
OneNote and MS Word 365
by
CWBillow
3 days, 9 hours ago -
Ultimate Mac Buyers Guide 2025: Which Mac is Right For You?
by
Alex5723
3 days, 9 hours ago -
Intel Unison support ends on Windows 11 in June
by
Alex5723
3 days, 10 hours ago -
April 2025 — still issues with AMD + 24H2
by
Kevin Jones
1 day, 1 hour ago -
Windows 11 Insider Preview build 26200.5518 released to DEV
by
joep517
3 days, 21 hours ago -
Windows 11 Insider Preview build 26120.3671 (24H2) released to BETA
by
joep517
3 days, 21 hours ago -
Forcing(or trying to) save Local Documents to OneDrive
by
PateWilliam
4 days, 6 hours ago -
Hotpatch for Windows client now available (Enterprise)
by
Alex5723
3 days, 18 hours ago -
MS-DEFCON 2: Seven months and counting
by
Susan Bradley
2 days, 19 hours ago -
My 3 monitors go black & then the Taskbar is moved to center monitor
by
saturn2233
4 days, 15 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.