473,732 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Spaces in UNC paths

Hi,

Could someone tell me the correct quotation to get around spaces in
paths for:

Server.MapPath( "\\server\share \spaces in name.mdb")

I know its bad practice to use spaces but unfortunately i cannot help
this.

Thanks,

Luke.
Oct 17 '06 #1
3 12411
Hi Luke
What I understand is that instead of back slash(\), u wanna use
space..If that is ur question then u can use replace function..
Replace("\","") ;
Like this u can define.
Regards
Raghav
Luke - ea********@gmai l.com wrote:
Hi,

Could someone tell me the correct quotation to get around spaces in
paths for:

Server.MapPath( "\\server\share \spaces in name.mdb")

I know its bad practice to use spaces but unfortunately i cannot help
this.

Thanks,

Luke.
Oct 17 '06 #2
raghav wrote:
Hi Luke
What I understand is that instead of back slash(\), u wanna use
space..If that is ur question then u can use replace function..
Replace("\","") ;
Like this u can define.
Regards
Raghav
Luke - ea********@gmai l.com wrote:
>Hi,

Could someone tell me the correct quotation to get around spaces in
paths for:

Server.MapPath ("\\server\shar e\spaces in name.mdb")

I know its bad practice to use spaces but unfortunately i cannot help
this.

Thanks,

Luke.
Hi,

Thanks for your reply but its not what i was looking for.

Using Server.MapPath( "\\server\share \spaces in name.mdb") Obviously
brings up a error because of the spaces in the UNC path.

For Eg.

Server.MapPath( "\\server\share \spaces[SPACE]in[SPACE]name.mdb")

For field names in a database you can get around spaces by using
("[field name]") But how can i do this for a UNC path?

The spaces _need_ to be there or the path is not valid.

Thanks,

Luke.

Oct 17 '06 #3
try representing your spaces as %20

or try it with the @

Server.MapPath( @"\\server\shar e\spaces in name.mdb")

Never tried either that I recall but one might work!

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com

<ea********@gma il.comwrote in message
news:e_******** ************@ec lipse.net.uk...
raghav wrote:
>Hi Luke
What I understand is that instead of back slash(\), u wanna use
space..If that is ur question then u can use replace function..
Replace("\","" );
Like this u can define.
Regards
Raghav
Luke - ea********@gmai l.com wrote:
>>Hi,

Could someone tell me the correct quotation to get around spaces in
paths for:

Server.MapPat h("\\server\sha re\spaces in name.mdb")

I know its bad practice to use spaces but unfortunately i cannot help
this.

Thanks,

Luke.
Hi,

Thanks for your reply but its not what i was looking for.

Using Server.MapPath( "\\server\share \spaces in name.mdb") Obviously brings
up a error because of the spaces in the UNC path.

For Eg.

Server.MapPath( "\\server\share \spaces[SPACE]in[SPACE]name.mdb")

For field names in a database you can get around spaces by using ("[field
name]") But how can i do this for a UNC path?

The spaces _need_ to be there or the path is not valid.

Thanks,

Luke.

Oct 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
6696
by: Jean-Marc Molina | last post by:
Hello, I can't find a way to execute a Windows application, whose directory path contains blank spaces, from a PHP script. I also wonder if the problem happens under Linux and other OS. Working dir : "C:\test copy" "copy.php" PHP script : <?php
3
3242
by: Jason | last post by:
Here's the code I'm using: #################################### import os, string for root, dirs, files in os.walk('/home/_Comedy'): for file in files: str = os.path.dirname(file) print root, str.strip(), "/", file.strip() ####################################
0
840
by: Chris Leffer | last post by:
Hi. I am using a regularexpressionvalidator control in order to validate paths. The validation expression is: (?:\w:)+ It only accept local paths. It works, but I need to do a better handling of extensions. I want to avoid spaces on the extensions, but allow them on the file names. Can anyone help me to change this expression?
1
3055
by: Pete | last post by:
I know MSBUILD doesn't like spaces in file paths when used as values of elements but I cannot find anything which documents the recommended handling etc... Any and all suggestions are appreciated.
0
1072
by: citizenkahn | last post by:
I am trying to parse a build log for errors. I figure I can do this one of three ways: - find the absolute platonic form of an error and search for that item - create definitions of what patterns describe errors for each tool which is used (ant, MSDEV, etc). - rework the build such that all the return codes for all 3rd party are captured and logged using my own error description The return code method has a high level of effort...
2
3717
by: Ken Brubaker | last post by:
Does the xsd.exe command line support paths with spaces? For example the xsd.exe /o: option specifies the output file name. How can I specify an output file path that has a space? I'v tried googling up and down and cannot find an answer.
17
6230
by: DesCF | last post by:
The following doesn't work: Dim photoPath As String = "R:\My Documents\My Pictures\MiscLL\" It doesn't work if I use double quotes either. It does work if I use a different path without spaces in it. What is the simple solution ? --
2
4132
by: Lance Hoffmeyer | last post by:
Hey all, As always, thanks in advance! I am trying to save a ppt presentation but am having problems regarding spaces and am wondering if I am doing something wrong or whether this is a bug? Also, is there a way around this other than not using spaces in paths or filenames? I can create filesnames without spaces but don't have much control over paths.
3
6023
by: BartlebyScrivener | last post by:
Using bash on Debian Etch. If word_doc = sys.argv and it's a file name like My\ Word.doc this function reads My and Word as two separate files unless the second '%s' is quoted. Took me a lot of trial and error to discover. Is this the most elegant way to do it? I was using popen originally, then saw some threads suggesting subprocess cured the spaces in path problem. def get_MSWordDoc_text(word_doc): """Harvests text from an MSWord...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.