Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


asp not executing

Posted on 2006-07-05
Medium Priority
Last Modified: 2010-04-17
I have a database at that I'm trying to make available on the local intranet at work using
asp. When I browse to the page all I see is the asp code.
I have a 2000 server and the physical location of the file I'm trying to open in internet
explorer is:

I have wsus and a sharepoint site on this server both of which are working fine.  
Incidentally the url of the sharepoint site is http://lhs1/default.aspx
I've tried browsing to C:\inetpub\wwwroot\computers\default.asp in internet explorer and
I've also tried browsing to http://lhs1/lhsintranet/default.asp in internet explorer but it
always just brings up the asp code.
I've tried going at this through MS Frontpage and "publishing" the page and nothing works. I realize there's alot I don't understand about all this and would appreciate any help you
can give me.

Here is the code:

<%@ Language=VBScript %>
           dim adoCon, rsSoftwareLicenses, sqlstr, htmlstr
            set adoCon = Server.CreateObject("ADODB.Connection")
            adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("fpdb/SoftwareLicenses.mdb")        

            set rsSoftwareLicenses = Server.CreateObject("ADODB.Recordset")
             sqlstr = "SELECT * FROM SoftwareLicenses order by LicenseType"
            rsSoftwareLicenses.Open sqlstr, adoCon
            htmlstr = ""
            htmlstr = htmlstr & "<table class='ark'>" & vbCr
            htmlstr = htmlstr & " <tr>" & vbCr
            htmlstr = htmlstr & "  <td class='hed'>LHS Software Licenses</td>" & vbCr
            htmlstr = htmlstr & "  <td class='darkcenter'>LicenseType</td>" & vbCr
            htmlstr = htmlstr & "  <td class='darkcenter'>License Number/Key Code</td>" & vbCr
            htmlstr = htmlstr & "  <td class='darkcenter'>Number Licenses</td>" & vbCr
            htmlstr = htmlstr & "  <td class='darkcenter'>PurchaseDate</td>" & vbCr
            htmlstr = htmlstr & "  <td class='darkcenter'>Supplier</td>" & vbCr
            htmlstr = htmlstr & "  <td class='darkcenter'>InvoiceNumber #</td>" & vbCr
            htmlstr = htmlstr & "  <td class='darkcenter'>UserName</td>" & vbCr
            htmlstr = htmlstr & "  <td class='darkcenter'>Notes</td>" & vbCr
            htmlstr = htmlstr & " </tr>" & vbCr

do while not rsSoftwareLicenses.EOF

            htmlstr = htmlstr & " <tr>" & vbCr
            htmlstr = htmlstr & "  <td><a href='/file.asp?ID=" & rsSoftwareLicenses("ID") & "'>" &           rsSoftwareLicenses("LastName") & "</a></td>" & vbCr
            htmlstr = htmlstr & "  <td>" & rsSoftwareLicenses("LicenseType") & "</td>" & vbCr
            htmlstr = htmlstr & "  <td>" & rsSoftwareLicenses("LicenseNumber/KeyCode") & "</td>" & vbCr
            htmlstr = htmlstr & "  <td>" & rsSoftwareLicenses("NumberLicenses") & "</td>" & vbCr
            htmlstr = htmlstr & "  <td>" & rsSoftwareLicenses("PurchaseDate") & "</td>" & vbCr
            htmlstr = htmlstr & "  <td>" & rsSoftwareLicenses("Supplier") & "</td>" & vbCr
            htmlstr = htmlstr & "  <td>" & rsSoftwareLicenses("InvoiceNumber") & "</td>" & vbCr
            htmlstr = htmlstr & "  <td>" & rsSoftwareLicenses("Users") & "</td>" & vbCr
            htmlstr = htmlstr & "  <td>" & rsSoftwareLicenses("Notes") & "</td>" & vbCr
            htmlstr = htmlstr & " </tr>" & vbCr

            set rsSoftwareLicenses = nothing
            set adoCon = Nothing
            htmlstr = htmlstr & "</table>" & vbCr



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">


<title>LHS Software Licenses</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link rel="stylesheet" type="text/css" href="lhs.css" />


<img border="0" src="fpdb/lhs_logo_red.JPG" width="399" height="180">&nbsp;
<div style="margin-left: 5%; margin-right: 5%;">
<h2>LHS Software Licenses</h2>



Question by:ksilvoso
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
  • 2

Author Comment

ID: 17043504
I forgot to say:
In IIS I have created the lhsintranet website, assigned an open port and started the website.
LVL 35

Expert Comment

ID: 17043535
is your project directory configured as an application in IIS?
LVL 16

Expert Comment

ID: 17043591
If you open it with a direct path, it will not get picked up by IIS and the ASP code will note get run

>> assigned an open port

If you manually assign a port other than 80, you must specify that port in the URL, e.g.if you use 85 then  http://lhs1:85/lhsintranet/default.asp

Otherwise, are you sure that ASP is installed & functioning within IIS?
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 17043624
It's listed as lhsintranet in application pools > sts app pool1

Author Comment

ID: 17043715
  When I tried accessing it with http://lhs1/lhsintranet/default.asp it brought up the asp code.
I assigned the port 85 to it (being sure that that port was unused first) and entered it as you suggested but now I get "Page cannot be found"  I tried a different port as well with the same results.  How can I be sure asp is installed and functioning?
Thanks, Karen
LVL 35

Expert Comment

ID: 17043831
open IIS, expand Web Sites folder, then expand Default Web Site, navigate to your application folder and see if it was configured as an application

Also check your application path to make sure your application folder is inside C:\Inetpub\wwwroot directory
LVL 16

Expert Comment

ID: 17043973
>> http://lhs1/lhsintranet/default.asp it brought up the asp code. I assigned the port 85 ... Page cannot be found

Clearly something is wrong there.  You probably have to stop and restart IISAdmin to get it to recognize port changes.  Is there a reason you want to use something other than 80?

>>How can I be sure asp is installed and functioning?
Put a very simple test file in C:\inetpub\wwwroot\test.asp, such as

This is text<br>
<%Response.write "This is asp<br>"%>

and on that machine goto http://localhost/test.asp

You should see both lines.

Author Comment

ID: 17044056
 In iis I have lhsintranet listed under websites and also under default websites. The icon is a gray folder. In the properties of the one under default websites it has default application listed beside application name with create as an option.  I tried creating one called lhsintranet but that didn't help so I deleted it and let it default back to "default application."
I selected scripts and executables in execute permissions.  The home dir for this listing is \lhsintranet and can't be changed.

The same options are selected for the lhsintranet listing directly under websites. The icon for this is a dark green globe.
The home dir of this listing are C:\Inetpub\wwwroot\LHSIntranet (which is correct)
and could be changed with the browse button.

Author Comment

ID: 17044093
When I was first setting it up it told me port 80 was used.  I just now changed it to 80 and it let me do it but it still doesn't work.  When I type http://lhs1:80/lhsintranet/default.asp it brings up the asp code and changes the address in the address bar to http://lhs1/lhsintranet/default.asp - it takes out the 80.
LVL 16

Accepted Solution

JohnBPrice earned 2000 total points
ID: 17044135
Yes, the "Default Web Site" uses port 80 by default.  If you are creating a new "web site", you would need to pick a different port number.  Note that there is probably no reason for you to create a new "web site", as a a path within your existing "Default Web Site" is usually adequate.

From your description, I suspect you have created BOTH a new web site and a path within your default web site.  You should remove the new web site "dark green globe" and forget about port number.

Note also that your folder or path in IIS does NOT need to be configured as an application for ASP to run (though there are some reasons you might want it to be).

Try the test file in C:\inetpub\wwwroot

Author Comment

ID: 17044237
   I've deleted all of them and I'm starting over.  When I right click on default website should I choose new website, new website from file, virtual dir, or virtual dir from file?
LVL 16

Expert Comment

ID: 17044263
If the test file shows you asp code, check in IIS Manager, right click on "Default Web Site", choose Properties, click the "Home Directory" tab, click "Configuration", and the "Mappings" tab.  You must have a line that maps the extension ".asp" to "C:\Windows\system32\inetsrv\asp.dll" with the verbs GET, HEAD, POST, and TRACE.
LVL 16

Expert Comment

ID: 17044314
If you put your folder under C:\Inetpub\wwwroot\, you needn't do anything.  Subfolders become part of your Default Web Site automatically.  

Reasons for choosing others are:

Vitrual directory -- Lets you point to a folder that is NOT under C:\inetpub\wwwroot and have IIS treat it as if it were.  For example you might want your web code to really reside on D:\whatever.  You can make a virtual directory so IIS translates  http://localhost/MyNewFolder to D:\Whatever instead of looking for C:\inetpub\wwwroot\MyNewFolder.

New Web Site:  When you run several web sites off one computer, for example shared hosting services do this so every customer can have their "own" web site.
LVL 16

Expert Comment

ID: 17044329
>>I've deleted all of them and I'm starting over.
Not including "Default Web Site" I presume.

>>When I right click on default website should I choose new website, new website from file, virtual dir, or virtual dir from file?

Actually, just put that test file up first to make things work before you spend a lot of time on it.


Author Comment

ID: 17045730
Success at last!!  I wound up creating a separate web again after all and assigning port 85 even though it is located inside wwwroot. Then I made it a virtual dir and now the page opens with this url:
The only thing that differs with your instructions, JohnBPrice, is the location of the folder.  I guess I could have put it elsewhere since I'm using the separate port and everything but it works.


Thanks a million for all your help.  I learned alot today.
LVL 16

Expert Comment

ID: 17046151
>>even though it is located inside wwwroot.

As long as you don't care about security, that's fine (it is now technically in both URLs http://lhs1:85 and http://lhs1/lhsintranet ).  Also, from your description, something is still messed up on "Default Web Site" as you should never see asp code in your browser.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Starting up a Project

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question