Linking Excel to Access via 'New Database Query' on a shared network

D

dickharlo

I'm linking Excel to an Access Database on a shared drive. I can
open
the excel spreadsheet and update external data without problem. What
appears to be happening to others, is they are using differenent
drive
letters to map to the same network location.

Linking through MS Query, my SQL is as follows:


SELECT CMPM_Grouping.Lead, CMPM_Grouping.`Path Type`,
CMPM_Grouping.Phase, CMPM_Grouping.`PMT ID`, CMPM_Grouping.`PMT
Title`, CMPM_Grouping.`Work Item`, CMPM_Grouping.`Regular Hours`,
CMPM_Grouping.`Paid OT`, CMPM_Grouping.`Non-Paid OT`,
CMPM_Grouping.`Total Hours`
FROM `Z:\Admin DB`.CMPM_Grouping CMPM_Grouping


Can I make this more generic....so instead of indicating drive Z, any
user can execute regardless of drive letter they have used?


Thanks
 
D

DrEvil

Use UNC path, it's always same.

\\servername\foldername\subfoldername if you have\file

That should be a rule when pointing to outside file of back end, you never
know, one day user might not get their drive mapped and your app would be
down, using UNC path it will not.

Amir
 
P

pietlinden

I'm linking Excel to an Access Database on a shared drive.  I can
open
the excel spreadsheet and update external data without problem.  What
appears to be happening to others, is they are using differenent
drive
letters to map to the same network location.

Linking through MS Query, my SQL is as follows:

SELECT CMPM_Grouping.Lead, CMPM_Grouping.`Path Type`,
CMPM_Grouping.Phase, CMPM_Grouping.`PMT ID`, CMPM_Grouping.`PMT
Title`, CMPM_Grouping.`Work Item`, CMPM_Grouping.`Regular Hours`,
CMPM_Grouping.`Paid OT`, CMPM_Grouping.`Non-Paid OT`,
CMPM_Grouping.`Total Hours`
FROM `Z:\Admin DB`.CMPM_Grouping CMPM_Grouping

Can I make this more generic....so instead of indicating drive Z, any
user can execute regardless of drive letter they have used?

Thanks

use the UNC path to the file...
\\servername\directory\filename.xls
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top