473,320 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Excel: query can only be refreshed if your using z: as your drive header

atljpe
11
In Excel: My query can only be refreshed if your using z: as your drive header. I want to change it so anyone can refresh this query wether they're using x, y, or z for their drive header:

The company I'm working with uses shared drives such as 'Sabntfilp001', each individual can have the same shared drive but may have different letters in front such as x:\Sabntfilp001\ or z:\Sabntfilp001\. The query will only recognize one or the other. This is the query:

Expand|Select|Wrap|Line Numbers
  1. ..Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data 
  2. Source=z:\PowderRiverDiv\ALLIANCE V2 PROJECT\Hostler Worksheet\Hostler Tracking Sheet.xls;Mode=ReadWrite;Extended Properties="HDR=YES;";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Engine Type=35;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False..
I've tried hard coding the actual drive into the Source (this worked with using VBA) but this didn't work.
This is my second time using a query so I not familiar with proper terminology so I hope my question is clear

I wasn't sure wich forum this should be under...please move this thread if need be

Thanks
atljpe
May 7 '07 #1
5 2601
Rabbit
12,516 Expert Mod 8TB
Aside from the drive which can be different from computer to computer, all shared network "drives" should have a name that you can use.

In your network drives folder, you'll see something in the format of:
Foldername on 'Network Drive Description (Network Drive Absolute Path)' (X: )
That Network Drive Absolute Path is what you want to use, just prefix it with \\.

So Music on 'Rabbits Music (RMusic)' (L: ) can be accessed using \\RMusic
May 7 '07 #2
atljpe
11
I'm not doing something(s) right.

Actual Network drives shows this from my computer: Opr on 'Sabntfilp001'( Z: )

Current query source:
Source=z:\PowderRiverDiv\ALLIANCE V2 PROJECT\Hostler Worksheet\Hostler Tracking Sheet.xls

Based on suggestion I tried these variations:

\\sabntfilp001\opr\PowderRiverDiv\ALLIANCE V2 PROJECT\Hostler Worksheet\Hostler Tracking Sheet.xls

\\Opr\sabntfilp001\PowderRiverDiv\ALLIANCE V2 PROJECT\Hostler Worksheet\Hostler Tracking Sheet.xls

\\sabntfilp001\PowderRiverDiv\ALLIANCE V2 PROJECT\Hostler Worksheet\Hostler Tracking Sheet.xls

please help

Thanks atljpe
May 8 '07 #3
Rabbit
12,516 Expert Mod 8TB
I'm not doing something(s) right.

Actual Network drives shows this from my computer: Opr on 'Sabntfilp001'( Z: )

Current query source:
Source=z:\PowderRiverDiv\ALLIANCE V2 PROJECT\Hostler Worksheet\Hostler Tracking Sheet.xls

Based on suggestion I tried these variations:

\\sabntfilp001\opr\PowderRiverDiv\ALLIANCE V2 PROJECT\Hostler Worksheet\Hostler Tracking Sheet.xls

\\Opr\sabntfilp001\PowderRiverDiv\ALLIANCE V2 PROJECT\Hostler Worksheet\Hostler Tracking Sheet.xls

\\sabntfilp001\PowderRiverDiv\ALLIANCE V2 PROJECT\Hostler Worksheet\Hostler Tracking Sheet.xls

please help

Thanks atljpe
Source=\\sabntfilp001\oprPowderRiverDiv\ALLIANCE V2 PROJECT\Hostler Worksheet\Hostler Tracking Sheet.xls

That should work. If not try relinking it using the network path rather than using the drive header.
May 8 '07 #4
atljpe
11
I didn't know it but I was disconnected from the drive when I tried this before so it couldn't work.

This one I previously tried does work:
\\sabntfilp001\opr\PowderRiverDiv\ALLIANCE V2 PROJECT\Hostler Worksheet\Hostler Tracking Sheet.xls

Thank you Rabbit for all your help

Satisfied once again with "The Scripts" knowledge base

:)
Brgds atljpe
May 8 '07 #5
Rabbit
12,516 Expert Mod 8TB
I didn't know it but I was disconnected from the drive when I tried this before so it couldn't work.

This one I previously tried does work:
\\sabntfilp001\opr\PowderRiverDiv\ALLIANCE V2 PROJECT\Hostler Worksheet\Hostler Tracking Sheet.xls

Thank you Rabbit for all your help

Satisfied once again with "The Scripts" knowledge base

:)
Brgds atljpe
Not a problem, glad to help.
May 8 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jeremy | last post by:
Hi, I am using the code below to create an excel document from data that is returned from an sql query. The formatting of the excel document is pretty and all is good unless I hit the back button...
8
by: Tom wilson | last post by:
This is driving me nuts. I'm trying to update an Excel spreadsheet using ADO.Net and Oledb in VB.Net. The connection is open, the adapter is connected and the dataset is loaded. Here's the code...
3
by: JohnM | last post by:
I can transfer from a query with DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Filenam", CPath, True I would like to use a form for the user to select and order data then...
9
by: Doug Glancy | last post by:
I got the following code from Francesco Balena's site, for disposing of Com objects: Sub SetNothing(Of T)(ByRef obj As T) ' Dispose of the object if possible If obj IsNot Nothing AndAlso...
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
1
by: chrspta | last post by:
I am new to Visual basic. I need a program using VB6 that converts txt files to excel file.Description is in the below: The form should have the Drive list, Dir list, file list and cmdConvert...
1
by: Pauline | last post by:
Dear all, I have an enormous database (Access 2003) containing sales information, and an Excel tool to enable end users to do planning and forecasting. Untill now I would create several queries,...
18
by: Paul Lautman | last post by:
JRough wrote: What do you mean by "redirect the output to Excel"??? Excel isn't a location, it's a spreadsheet program that some (but not all users) will have on their machine. BTW, Location:...
1
by: chandhseke | last post by:
Hi folks, I am a newbie to this functionality of creating excel report using VB/VB Script. I have been given a code and asked to add filters to the excel sheet that is created using the below...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.