Active(X) Server Pages (ASP) is a language-independent framework designed by
Microsoft to generate dynamic web content. It allows coding of server-side
scripts that are executed by a Web server in response to a user's request for
a URL. ASP scripts are similar to other server-side scripting technologies
like Java Server Pages, Perl Server Pages and so on.
An ASP page is a standard ASCII text file that contains both HTML tags and
scripting code. Typical scripting languages that can be embedded into ASP
pages are VBScript and JavaScript. All scripting portions are delimited
by <% and %> tags. Example ASP page:
<html>
Current date and time is:
<%
' Start comments with "'"
response.write "<B>"
response.write Now() ' writes the current date and time.
%>
</html>
Active Server Pages (ASP) is a Microsoft standard, which is easier to
develop than Java Server Pages (JSP). ASP supports multiple scripting languages
(VBScript, JavaScript, etc), but is limited to Microsoft supported platforms
and software.
JSP supports customizable tags and is independent of platform and server
technologies. Code is developed using the standard Java programming language.
Either ODBC or JDBC is used to connect to Oracle (and other) databases.
JSP is usually used for larger enterprise scale applications.
For more information about JSP Pages, see the
JDBC FAQ.
Follow these steps to ensure your server can connect to Oracle:
Make sure that you can use simple ASP pages. Upload (FTP) the example above
to your server and see if you can access it via a Web Browser.
Install the Oracle Client CD on your server. This will install SQL*Net,
OO4O (Oracle Objects for OLE) and the Oracle ODBC drivers on your system.
Configure SQL*Net and ensure you can tnsping and connect your Oracle
database. This is done by adding an entry to the TNSNAMES.ORA file or by using utilities
like the "Net Easy Configurator" to do it for you. See the SQL*Net FAQ for details.
Optionally configure ODBC by creating a System DSN (Data Source Name). This
can be done from the "32-Bit ODBC Administrator" in the Control Pannel.
Alternatively one can use OO4O (no configuration required), or "DSNless"
ODBC connection. See the ODBC FAQ for details.
The following example domonstrated ODBC connectivity:
<%
Set OraDatabase = Server.CreateObject("ADODB.Connection")
OraDatabase.Open "dsn=OracleDSN;uid=userid;pwd=password;"
Set osRecordSet = OraDatabase.Execute("SELECT * FROM EMPLOYEE")
Response.Write "<table border=1 cellpadding=4>"
Response.Write "<tr>"
For I = 0 To osRecordSet.Fields.Count - 1
Response.Write "<td><b>" & osRecordSet(I).Name & "</b></td>"
Next
Response.Write "</tr>"
Do While Not osRecordSet.EOF
Response.Write "<tr>"
For I = 0 To osRecordSet.Fields.Count - 1
Response.Write "<td>" & osRecordSet(I) & "</td>"
Next
Response.Write "</tr>"
osRecordSet.MoveNext
Loop
Response.Write "</table>"
osRecordSet.Close
OraDatabase.Close
%>