LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Relative path in database query connection string

The connection string is a String that you can modfiy like any string (DUH!)

from
Connection = "DSN=Excel Files;DBQ=C:\Folder1\Folder2\Folder3\Filename.xls; "

to
Folder = "C;\Temp\"
Connection = "DSN=Excel Files;DBQ=" & Folder & "Filename.xls;"



"DanL" wrote:

I have a connection string that starts out like this:

DSN=Excel Files;DBQ=C:\Folder1\Folder2\Folder3\Filename.xls;

This is an absolute path, but I would like to use a relative path (i.e.
..\Filename.xls without the preceding path) instead. Is this possible?

In this case I am actually using this connection string within the
Filename.xls file. So what I would REALLY like is for the connection string
to refer to the path of the file that is using it. This way, if I save a
copy of the file Filename.xls as Filename2.xls, I don't have to change the
connection string and it will automatically point to Filename2.xls.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use relative address for database query Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 3 November 21st 08 08:53 PM
Relative path to Access database Richard Excel Discussion (Misc queries) 2 April 7th 08 03:14 PM
How do I use a connection string? BrandenK Excel Discussion (Misc queries) 0 September 25th 07 07:10 PM
how to change absolute path to relative path hwijgerse Excel Worksheet Functions 0 November 25th 05 07:18 AM
Excel Database Query String Too Long Karl Burrows Excel Discussion (Misc queries) 4 January 27th 05 06:25 AM


All times are GMT +1. The time now is 08:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"