473,394 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Which server am I on?

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
Mar 12 '06 #1
3 1121
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"
Mar 12 '06 #2
Request.ServerVariables("Server_Name")

Bob Lehmann

"MikeR" <nf********@pobox.com> wrote in message
news:ex**************@TK2MSFTNGP11.phx.gbl...
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

Mar 12 '06 #3
Thanks Bobs. Works a charm.
Mike
Mar 12 '06 #4

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

Similar topics

21
by: Rabbit63 | last post by:
Hi: I want to show a set of records in the database table on the clicnt browser. I have two ways to do this (writen in JScript): 1.The first way is: <% var sql = "select firstname from...
1
by: gregs | last post by:
Hi folks, I need to know which EXE's of SP3 to install with SQL Server 2000 Personal Edition. From the Microsoft website: ...
6
by: H | last post by:
This is a question that has haunted me for quite some time. if you build a 4 tier database application where the 4th tier is the database server (MS SQL 2000), where do you build the connection...
4
by: Hai Nguyen | last post by:
I'm learning C sharp and do not like vb much. I'm creatiing a wepage using panel to test myself. I tried to use these code below, which is written in VB, and to transform them to c sharp but I got...
33
by: Jeff | last post by:
I know this is a difficult one to answer, but I am interested in opinions on what hardware upgrades would be recommended with the following. Access 2000 running in a split config, but all in...
15
by: Rob Meade | last post by:
Hi all, I have a databse which I'm pulling the data from for my ASP page. I have 4 tables, Course, Feature, Objective, and PreRequisite. The last three all contain a course product code and a...
5
by: alingsjtu | last post by:
Hello, every body. When execute dynamic generated multiple OPENQUERY statements (which linkes to DB2) in SQLServer, I always got SQL1040N The maximum number of applications is already connected...
2
by: smithaanna | last post by:
Hi, How can i connect to the sql server database(installed microsoft visual 2005 professional edition in which sql server 2005 express edition)a pc which is XP Professional SP2 and is in a...
84
by: Patient Guy | last post by:
Which is the better approach in working with Javascript? 1. Server side processing: Web server gets form input, runs it into the Javascript module, and PHP collects the output for document prep....
23
by: shashi shekhar singh | last post by:
Dear sir, I have a word document file contains text and images, now i have saved it as a web page and wants to display it on browser , using , string str=directory.getfiles("");...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.