ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need new idea for universal path (https://www.excelbanter.com/excel-programming/273300-re-need-new-idea-universal-path.html)

Dan Merchant

Need new idea for universal path
 
Tod,

Make sure you are using unc naming in your hard coded path. I.e. rather
than "f:\foldername\filename" use \\servername\foldername\filename.

Good luck

"Tod" wrote in message
...
My former solution to this problem has to change.

The former scenario:
I had a workbook in a folder on a server. In that same
folder I had a database. In my ADO code I had my
connection to the path and database name. Problem is that
when users tried to run the code from the workbook, the
connection string failed because the path (for them)was
incorrect. The solution was to put the path as
ThisWorkbook.Path and then the database name.

New Scenario:
As the list of files on the server has grown, I've
organized everything into subfolders. Now the workook and
database are on the same server, but one is in a Reports
folder and the other is a Database folder. So
ThisWorkbook.Path will not longer work as a part of the
connection string.

So... if you are still reading.... here's what I need. I
want to be able to run the workbook and it's ADO code from
within the server. That's easy enough. I can hard code the
path to the database. BUT.. I also want select users (as a
back up in case I'm 'hit by the proverbial bus') to be
able run the workbook from a folder on their computer that
I've shared to a folder on the server. The hard-coded path
for the connection string will not work.

Does anybody understand what I'm talking about?

tod





All times are GMT +1. The time now is 05:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com