Spaces in UNC paths

L

Luke - eat.lemons

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.
 
R

raghav

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
 
L

Luke - eat.lemons

raghav said:
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
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.
 
J

John Timney \(MVP\)

try representing your spaces as %20

or try it with the @

Server.MapPath(@"\\server\share\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

raghav said:
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
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.
 

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

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top