Checking if ASP is enabled on a server?

Dukat

Resident Freddy
Joined
Jan 10, 2004
Messages
5,396
Hey all

Just wondering, how do I go about checking if ASP is enabled on a webserver? I'm currently putting together a website and it looks like it may not be enabled, I'm not exactly an expert in this web dev stuff (I've only just left college), but I had imagined that there would be a setting on the server somewhere, cant seem to find it :\

I've got a database on the server and I'm trying to pull data out of it via a DNSless connection and all the code looks ok. I'm putting the data from the database into variables, then putting the variables into text fields using the "Value= <% response.write(variable) %> " code, however all I end up with is a text field with a "<%" in it and an extra ">" immediately after the text field.

I've put "response.write("test")" in the code at several areas, hoping that it will give me an indication of how much of the code is being executed, but none of them appear, furthermore when I hit view source on the page it seems to show the ASP code, I thought this wasnt meant to happen if ASP the code was being run properly?

This, in addition to the "<%" being shown in the text field, leads me to believe that ASP isnt enabled on the server, however as I said, I'm, not very experienced at this sort of thing so I thought I'd ask you lot in the hope that someone can spot what stupid mistake I'm making :) I've tried the usual workarounds, fiddling with the code, google searching, looking at old projects that work and trying to spot a difference in the current project, all of which has'nt seemed to help.

Here's the code listing, incase this helps to show where I've made a stupid mistake :)
<%

response.write("1") <- this is not being written

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(server.MapPath("../database/DB.mdb"))
set rs=Server.CreateObject("ADODB.recordset")

Dim PRODUCT_CODE
Dim PRODUCT_DESC
Dim PRODUCT_ATTR
Dim PRODUCT_SIZE
Dim PRODUCT_DEPT
Dim PRODUCT_SECT
Dim PRODUCT_LINE
Dim PRODUCT_BRAND
Dim PRODUCT_VAT
Dim PRODUCT_UNIT
Dim PRODUCT_TEXT
Dim PRODUCT_BARCODE
Dim PRODUCT_BINNO
Dim PRODUCT_SUPCODE
Dim PRODUCT_SUPACCREF
Dim PRODUCT_SUPP
Dim PRODUCT_SPRICE

PRODUCT_CODE = Request.Form("TXTCODE")

response.write("2") <- this is not being written

RESULT = "SELECT * FROM ProductListing WHERE ProductCode = '" & PRODUCT_CODE & "'; "

rs.open RESULT, conn



PRODUCT_DESC = rs("Description")
PRODUCT_ATTR = rs("Attirbute")
PRODUCT_SIZE = rs("Size")
PRODUCT_DEPT = rs("Department")
PRODUCT_SECT = rs("Section")
PRODUCT_LINE = rs("ProductLine")
PRODUCT_BRAND = rs("Brand")
PRODUCT_VAT = rs("VAT")
PRODUCT_UNIT = rs("UnitofSale")
PRODUCT_TEXT = rs("Text")
PRODUCT_BARCODE = rs("BarCode")
PRODUCT_BINNO = rs("BinNo")
PRODUCT_SUPCODE = rs("SupplierCode")
PRODUCT_SUPACCREF = rs("SupplierAccountRef")
PRODUCT_SUPP = rs("Supplier")
PRODUCT_SPRICE = rs("SalesPrice")

rs.close
conn.close

%>

</HEAD>
<BODY>
<BR>
<BR>

<FORM>

<INPUT TYPE=TEXT SIZE=20 NAME=TXTCODE>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTDESC VALUE=<% response.write("PRODUCT_DESC") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTATTR VALUE=<% response.write("PRODUCT_ATTR") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTSIZE VALUE=<% response.write("PRODUCT_SIZE") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTDEPT VALUE=<% response.write("PRODUCT_DEPT") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTSECT VALUE=<% response.write("PRODUCT_SECT") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTLINE VALUE=<% response.write("PRODUCT_LINE") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTBRAND VALUE=<% response.write("PRODUCT_BRAND") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTVAT VALUE=<% response.write("PRODUCT_VAT") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTUNIT VALUE=<% response.write("PRODUCT_UNIT") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTTEXT VALUE=<% response.write("PRODUCT_TEXT") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTBARCODE VALUE=<% response.write("PRODUCT_BARCODE") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTBINNO VALUE=<% response.write("PRODUCT_BINNO") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTSUPPCODE VALUE=<% response.write("PRODUCT_SUPPCODE") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTSUPPACCREF VALUE=<% response.write("PRODUCT_SUPPACCREF") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTSUPP VALUE=<% response.write("PRODUCT_SUPP") %>>
<INPUT TYPE=TEXT SIZE=20 NAME=TXTSPRICE VALUE= <% response.write(PRODUCT_SPRICE) %> > <-quotes taken out to see if it helped, didnt make a difference at all
<INPUT TYPE=SUBMIT NAME=BTNSUBMIT VALUE="SUBMIT">

</FORM>

Any help much appreciated as always :)
 

Shovel

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,350
If the ASP code is being returned in the source then ASP isn't running.
Who is your webhost? Their website should tell you if they have ASP installed.

Obvious make sure you're running it with a ‘.asp’ extension.

To be honest, with ASP being a bit of a legacy technology these days and due to the expense of running Windows servers you'll find most affordable hosts will run PHP instead.
 

Dukat

Resident Freddy
Joined
Jan 10, 2004
Messages
5,396
Cheers for the swift reply :) Just been reading your Web Professionalism thread and it was really interesting and thought provoking.

Anyway, on topic - I've done some checking since I posted and it seems that the host does use Sun ONE ASP, but I'm not certain if its activated on our domain, I need to do some checking for that I think.

My problem is, as was said in the web professionalism thread, that when I was taught how to create web pages, we were only told how to do things in ASP. I guess a read up of PHP is in order, the problem is that I'll then have to learn a new language just for this job - I seriously doubt I'll be going into this sort of thing as a career (I'm headed for the forces as soon as my college results come through). One reason I started using ASP initially rather than look at PHP was that it seems better for database connections, with PHP it sounded alot more complex, but admittedly I've not really looked at PHP much at all yet.

Cheers for the help, I'll look into PHP and see what its like :)
 

phlash

Fledgling Freddie
Joined
Dec 24, 2003
Messages
195
Dukat said:
I've done some checking since I posted and it seems that the host does use Sun ONE ASP, but I'm not certain if its activated on our domain, I need to do some checking for that I think

If they are running on SunONE, then it's on Solaris and although ASP may work, it may not run any VBScript in your ASP pages, depending what version of SunONE ASP (http://www.sun.com/software/chilisoft/). Definitely worth finding out what your host *does* support before you waste any more of your time writing code that won't run :)
 

Padwah

Fledgling Freddie
Joined
Dec 25, 2003
Messages
127
To be honest, if you've got a linux box then you'd be better off just sticking to PHP. Chillsoft ASP is pretty basic and I wouldn't rely on it for anything, if you want to run ASP get yourself a Windows host.
 

Users who are viewing this thread

Top Bottom