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
-
WU help needed with “Some settings are managed by your organization”
by
Peobody
47 minutes ago -
No Newsletters since 27 January
by
rog7
3 hours, 14 minutes ago -
Linux Mint Debian Edition 7 gets OEM support, death of Ubuntu-based Mint ?
by
Alex5723
3 hours, 35 minutes ago -
Windows Update “Areca Technology Corporation – System – 6.20.0.41”
by
Bruce
38 minutes ago -
Google One Storage Questions
by
LHiggins
5 hours, 55 minutes ago -
Button Missing for Automatic Apps Updates
by
pmcjr6142
1 hour, 11 minutes ago -
Ancient SSD thinks it’s new
by
WSila
9 hours, 53 minutes ago -
Washington State lab testing provider exposed health data of 1.6 million people
by
Nibbled To Death By Ducks
13 hours, 53 minutes ago -
WinRE KB5057589 fake out
by
Susan Bradley
7 hours, 13 minutes ago -
The April 2025 Windows RE update might show as unsuccessful in Windows Update
by
Susan Bradley
20 hours, 5 minutes ago -
Firefox 137
by
Charlie
4 hours, 42 minutes ago -
Whisky, a popular Wine frontend for Mac gamers, is no more
by
Alex5723
1 day, 2 hours ago -
Windows 11 Insider Preview build 26120.3863 (24H2) released to BETA
by
joep517
1 day, 2 hours ago -
Windows 11 Insider Preview build 26200.5551 released to DEV
by
joep517
1 day, 2 hours ago -
New Windows 11 PC setup — can I start over in the middle to set up a local id?
by
ctRanger
2 hours, 32 minutes ago -
Windows 11 Insider Preview Build 26100.3902 (24H2) released to Release Preview
by
joep517
1 day, 6 hours ago -
Oracle kinda-sorta tells customers it was pwned
by
Nibbled To Death By Ducks
1 day, 12 hours ago -
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
1 day, 22 hours ago -
Office apps read-only for family members
by
b
2 days, 1 hour ago -
Defunct domain for Microsoft account
by
CWBillow
1 day, 21 hours ago -
24H2??
by
CWBillow
4 hours, 26 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
1 day, 6 hours ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
10 hours, 45 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
21 hours, 19 minutes ago -
two pages side by side land scape
by
marc
3 days, 22 hours ago -
Deleting obsolete OneNote notebooks
by
afillat
4 days ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
3 days, 3 hours ago -
Security Essentials or Defender?
by
MalcolmP
3 days, 6 hours ago -
April 2025 updates out
by
Susan Bradley
4 hours ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
2 days, 23 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.