troubleshooting Question

Change connection string to use relative path instead of full path

Avatar of StevenPMoffat
StevenPMoffat asked on
Microsoft Excel
7 Comments2 Solutions9515 ViewsLast Modified:
I want to change my query  connection string that is used on one tab of a workbook and extracts information from another tab on the same workbook.   In the old days this was called using a relative pathname instead of a fullpathname.  The reason I want this is that I want to be able to move the file to another folder or give the file to someone else and I want the queries to still work.   Here is a sample connection string.
DSN=Excel Files;DBQ=C:\Documents and Settings\moffats\My Documents\aBudget\Source.xls;DefaultDir=C:\Documents and Settings\moffats\My Documents\aBudget;DriverId=1046;FIL=excel 12.0;MaxBufferSize=2048;PageTimeout=5;

The other thing that I note which I don't understand is that this excel workbook is a macro enabled workbook, yet the filename has only a .xls???  Reason?  The queries work fine until I move the file to another location.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros