Which server am I on?

Discussion in 'ASP General' started by MikeR, Mar 12, 2006.

  1. MikeR

    MikeR Guest

    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
     
    MikeR, Mar 12, 2006
    #1
    1. Advertising

  2. 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"
     
    Bob Barrows [MVP], Mar 12, 2006
    #2
    1. Advertising

  3. MikeR

    Bob Lehmann Guest

    Request.ServerVariables("Server_Name")

    Bob Lehmann

    "MikeR" <> wrote in message
    news:...
    > 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
    >
    >
     
    Bob Lehmann, Mar 12, 2006
    #3
  4. MikeR

    MikeR Guest

    Thanks Bobs. Works a charm.
    Mike
     
    MikeR, Mar 12, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    0
    Views:
    372
  2. -
    Replies:
    2
    Views:
    444
    Alan Krueger
    Jul 29, 2005
  3. Familyman
    Replies:
    3
    Views:
    543
    Alan J. Flavell
    Feb 9, 2006
  4. Kenny
    Replies:
    0
    Views:
    487
    Kenny
    Jun 2, 2004
  5. chetan
    Replies:
    5
    Views:
    396
    John Harrison
    Sep 21, 2004
Loading...

Share This Page