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
-
Windows 10 Build 19045.5794 (22H2) to Release Preview Channel
by
joep517
1 hour, 59 minutes ago -
Windows 11 Insider Preview Build 22635.5235 (23H2) released to BETA
by
joep517
2 hours, 28 minutes ago -
A Funny Thing Happened on the Way to the Forum
by
bbearren
13 hours, 24 minutes ago -
Download speeds only 0.3Mbps after 24H2 upgrade on WiFi and Ethernet
by
John
8 hours, 8 minutes ago -
T-Mobile 5G Wireless Internet
by
WSmmi16
4 hours, 23 minutes ago -
Clock missing above calendar in Windows 10
by
WSCape Sand
1 hour, 23 minutes ago -
Formula to Calculate Q1, Q2, Q3, or Q4 of the Year?
by
WSJon5
17 hours, 14 minutes ago -
The time has come for AI-generated art
by
Catherine Barrett
1 day, 1 hour ago -
Hackers are using two-factor authentication to infect you
by
B. Livingston
6 hours, 58 minutes ago -
23 and you
by
Max Stul Oppenheimer
14 hours, 12 minutes ago -
April’s deluge of patches
by
Susan Bradley
18 hours, 23 minutes ago -
Windows 11 Windows Updater question
by
Tex265
1 day ago -
Key, Key, my kingdom for a Key!
by
RetiredGeek
1 day, 23 hours ago -
Registry Patches for Windows 10
by
Drcard:))
2 days, 3 hours ago -
Cannot get line length to NOT wrap in Outlining in Word 365
by
CWBillow
1 day, 10 hours ago -
DDU (Display Driver Uninstaller) updates
by
Alex5723
19 hours, 27 minutes ago -
Align objects on a OneNote page
by
CWBillow
2 days, 9 hours ago -
OneNote Send To button?
by
CWBillow
2 days, 9 hours ago -
WU help needed with “Some settings are managed by your organization”
by
Peobody
2 days, 18 hours ago -
No Newsletters since 27 January
by
rog7
22 hours, 54 minutes ago -
Linux Mint Debian Edition 7 gets OEM support, death of Ubuntu-based Mint ?
by
Alex5723
1 day, 18 hours ago -
Windows Update “Areca Technology Corporation – System – 6.20.0.41”
by
Bruce
1 day, 17 hours ago -
Google One Storage Questions
by
LHiggins
1 day, 1 hour ago -
Button Missing for Automatic Apps Updates
by
pmcjr6142
1 day, 8 hours ago -
Ancient SSD thinks it’s new
by
WSila
1 day, 23 hours ago -
Washington State lab testing provider exposed health data of 1.6 million people
by
Nibbled To Death By Ducks
3 days, 9 hours ago -
WinRE KB5057589 fake out
by
Susan Bradley
19 hours, 43 minutes ago -
The April 2025 Windows RE update might show as unsuccessful in Windows Update
by
Susan Bradley
2 days, 17 hours ago -
Firefox 137
by
Charlie
1 hour, 5 minutes ago -
Whisky, a popular Wine frontend for Mac gamers, is no more
by
Alex5723
3 days, 21 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.