Spaces in UNC paths

  • Thread starter Thread starter Luke - eat.lemons
  • Start date Start date
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.
 
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 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.
 
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.
 
Back
Top