Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Which server am I on?

Reply
Thread Tools

Which server am I on?

 
 
MikeR
Guest
Posts: n/a
 
      03-12-2006
My ISP has parent paths disabled, and my local box does not. I'd like to
be able to tell where a page is executing so I can code an if statement
for my db connection strings.

if RunningOnThag then
Server.MapPath("../fpdb/materiale.mdb")
else
Server.MapPath("/fpdb/materiale.mdb")
end if

TIA,
Mike


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      03-12-2006
MikeR wrote:
> My ISP has parent paths disabled, and my local box does not. I'd like
> to be able to tell where a page is executing so I can code an if
> statement for my db connection strings.
>
> if RunningOnThag then
> Server.MapPath("../fpdb/materiale.mdb")
> else
> Server.MapPath("/fpdb/materiale.mdb")
> end if

..
Request.ServerVariables("SERVER_NAME")

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
 
Bob Lehmann
Guest
Posts: n/a
 
      03-12-2006
Request.ServerVariables("Server_Name")

Bob Lehmann

"MikeR" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> My ISP has parent paths disabled, and my local box does not. I'd like to
> be able to tell where a page is executing so I can code an if statement
> for my db connection strings.
>
> if RunningOnThag then
> Server.MapPath("../fpdb/materiale.mdb")
> else
> Server.MapPath("/fpdb/materiale.mdb")
> end if
>
> TIA,
> Mike
>
>



 
Reply With Quote
 
MikeR
Guest
Posts: n/a
 
      03-12-2006
Thanks Bobs. Works a charm.
Mike
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microcontrollers: which one ? which language ? which compiler ? The Jesus of Suburbia NZ Computing 2 02-11-2006 06:53 PM
Web Stats? Which to use? Which is best? Familyman HTML 3 02-09-2006 11:05 PM
ADSL WIC support - which NM's, and which IOS versions? Kralizec Craig Cisco 5 12-08-2005 02:20 AM
Server to server = Server client to server? - Java 2 07-29-2005 10:46 PM
Keeping track of which user controls need to be loaded and which not John ASP .Net 0 07-08-2003 09:26 AM



Advertisments