Active Server Pages FAQ


Table of Contents

  1. What is ASP and how can I use it?
  2. Where can I find documentation and resources for ASP?
  3. What version of ASP are you running?
  4. What file extension should I use for my ASP files?
  5. How do I connect to my database from ASP?
  6. How do I send mail using ASP?
  7. How do I use server-side includes with ASP?

What is ASP and how can I use it?

ASP is a server-side scripting language that can be used to generate dynamic content conditionally or from a database. More info.

Where can I find documentation and resources for ASP?

  • The Sun ONE ASP documentation (formerly Sun Chili!Soft ASP) is a good place to start.
  • A good site for learning ASP is, aptly named, LearnASP.
  • A network of other ASP support sites can be found at asp101.com's link section. There are some excellent articles there too.

What version of ASP are you running?

Sun ONE ASP version 4.0.2. This is the version of ASP that runs on Linux and there are some differences between ASP on Microsoft's IIS web server and the Sun ONE version on f2o.org's Apache servers.

What file extension should I use for my ASP files?

You should use an .asp file extension.

How do I connect to my database from ASP?

<%
ConnString = "Driver={MySQL};" _
& "SERVER=localhost;" _
& "DATABASE=username;" _
& "UID=username;" _
& "PASSWORD=password"

Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.Open ConnString

' connection has now been made.
' the connection object is DataConn
%>

How do I send mail using ASP?

<%
Set mail = Server.CreateObject("CDONTS.NewMail")
mail.Host = "localhost"
mail.To = "to@domain.com"
mail.From = "from@domain.com"
mail.Body = "test"
mail.Send
%>
More information on sending email via an ASP web page can be found in the Chili!soft Documentation for Chili!Mail (SMTP) Component.

How do I use server-side includes with ASP?

You can use either file or virtual to include files with ASP. You do not need to use the full root path. Below is a sample that assumes that your include files are within a directory under public_html entitled includes.

<% your ASP code.. %>
<!--#include virtual ="/includes/myfile.asp"-->

<!--#include file ="includes/myfile.asp"-->
<% your ASP code.. %>

Need More Help?

Progressive Networks has a number of support options in addition to our FAQ's available for our members: