Sample Database Application for Active Server Pages
Ephox, July 2001
Introduction
Pre-requisites
Retrieving the Sample Source Code
Files included in this sample
The Database
I_ADOVBS.ASP
I_DATABASE.ASP
The Index Page (start.asp)
Adding a New Article (add.asp and xt_add.asp)
Editing an Existing Article (edit.asp and xt_edit.asp)
Deleting an Existing Article (delete.asp and xt_delete.asp)
Viewing an Article (view.asp)
This article shows how to use EditLive! as the interface for a database
driven press release center. This sample allows users to:
- add new press articles;
- edit existing press articles;
- view the article in the web browser; and
- delete existing press articles.
Pre-requisites
This example uses client-side JavaScript within HTML.
Active Server Pages using VBScript is used for the server-side
scripting. Please ensure that before working through this sample you have
read Using EditLive! with an Online Database or
in an Online Form.
Retrieving the Sample Source Code
The source code for this sample will have been installed on your
machine when you installed the Ephox EditLive! 4.0 Development Kit. To
view the source code please click on Start->Programs->Ephox
EditLive!->Open Source Code. If you have Microsoft IIS or
Personal Web Server installed on your local machine, to run this sample through
your web server please click on the shortcut in the Ephox EditLive!
folder in the Programs menu.
Files included in this sample
Below is a table outlining the ten files included in this sample.
| i_adovbs.asp |
This file allows the use of ADO objects for creating
database recordsets. |
| i_database.asp |
This file defines the connection string used to connect to
the online database. |
| start.asp |
This file searches the database and creates a list of
articles that are available for editing within EditLive!. It also
supplies links to allow users to add a new article or delete any of the
existing articles. |
| add.asp |
This file allows users to use EditLive! to create new
articles to store in the database. |
| xt_add.asp |
This file adds the new article created using EditLive! to
the database. |
| edit.asp |
This file loads an existing article into EditLive! for
modification. |
| xt_edit.asp |
This file updates the modified article contents in the
database. |
| view.asp |
This file displays the chosen article in the web browser. |
| delete.asp |
This file confirms that you wish to delete a specified
article. |
| xt_delete.asp |
This file deletes an existing article from the database. |
The database used in this sample is a Microsoft Access database named content.mdb.
Below is a table outlining the fields within the database table articles and
a description of the information each field stores.
| article_id |
A unique number used to identify the article record. |
| article_title |
The title or headline of the article. |
| article_body |
The actual article content. |
| article_StyleElementText |
The styles used to format the article if content was
pasted in to EditLive! from Microsoft Word. |
I_ADOVBS.ASP
Purpose - This file is used to define the ADO objects that this sample
uses to connect to the online database. This is a standard file issued by
Microsoft as part of the ASP library. Please include this file whenever
interaction with the online database is required within a page.
I_DATABASE.ASP
Purpose - This file defines the ADO connection string used to connect
with the online database. Therefore, it also needs to be included whenever
a page interacts with the database to retrieve or save information.
' Construct
the connection string for the ADO Connection
strConnection = "DBQ=" & Server.Mappath("..\content.mdb")
& ";" & _
"DefaultDir=" & Server.Mappath(".") &
"\..\" & ";" & _
"UID=admin;" & _
"Driver= {Microsoft AccessDriver(*.mdb)};DriverId=25;FIL=MS
Access;" |
The Index Page (start.asp)
Purpose - The index page of the press release center lists all of the
articles currently available in the database. Users are able to:
- create a new article using EditLive!;
- edit an existing article using EditLive!; or
- delete an existing article from the press database.
Step 1 - Include the i_adovbs.asp and i_database.asp files to connect
to the database.
<!--#INCLUDE
FILE="i_database.asp"-->
<!--#INCLUDE FILE="i_adovbs.asp"--> |
Step 2 - Create a link in the page to the file add.asp to allow users
to use EditLive! to create a new article.
| <P><A
href="add.asp">Create
a new article</A></P> |
Step 3- Connect to the database and retrieve all of the existing
articles listed in the articles table.
<%
' Instantiate an ADO Connection object
Set objDBConn=
Server.CreateObject("ADODB.Connection")
' Open the connection using the connection string
' defined in the included file "i_database.asp"
objDBConn.Open strConnection
' Instantiate an ADO Recordset object
Set rsArticle =
Server.CreateObject("ADODB.Recordset")
' Construct the SQL to be used to open the recordset
CommandText = "SELECT * FROM articles"
' Open the recordset with a static cursor
rsArticle.Open CommandText, objDBConn, adOpenStatic
' Are there any records in the recordset?
If Not rsArticle.BOF Then
%> |
Step 4 - Use embedded ASP to loop through the recordset of articles to
create a table which lists all of the existing articles by title. Then,
for each article, create a link to the:
- View page to view the article,
- Edit page to edit the article using EditLive!, and
- Delete page to delete the article from the database.
Append the article_id to all of the links so that the relevant article is
known.
<TABLE
cellpadding="3"
cellspacing="0"
border="0">
<TR>
<TH>ID</TH>
<TH width="250">Title</TH>
<TH>Available Actions</TH>
</TR>
<%
' There are records. Loop through all the records in the
' recordset and write out a table row for each record
Do While Not rsArticle.EOF
%>
<TR>
<TD><%=rsArticle("article_id")%></TD>
<TD><%=rsArticle("article_title")%></TD>
<TD><A href="view.asp?article_id=<%=rsArticle("article_id")%>">View</A>
|
<A href="edit.asp?article_id=<%=rsArticle("article_id")%>">Edit</A>|
<A href="delete.asp?article_id=<%=rsArticle("article_id")%>">Delete</A></TD>
</TR>
<%
' Move to the next row in the recordset
rsArticle.MoveNext()
Loop
%>
</TABLE> |
Step 5 - Add an ELSE statement to the IF loop to let users know if
there are no records in the database.
<%
Else
' There are no records. Tell the user.
%>
<P>There are no records in
the database. Click <STRONG>Add
an Article</STRONG>
to add a record to the database.</P>
<%
End If
%> |
Step 6 - Release the memory being used for the database connection and
the article recordset.
<%
' Release the memory consumed by the objects
Set rsArticle =
Nothing
Set objDBConn = Nothing
%>
|
Adding a New Article (add.asp and xt_add.asp)
Purpose - The file add.asp is used to create a new article using
EditLive!. Once the article is complete, it is then added to the database
using the processing page, xt_add.asp.
Add.asp
Step 1 - Start with a standard HTML page containing EditLive! running
in HTMLString mode. To see the steps involved in creating this page please
see Using EditLive! with an Online Database or
in an Online Form.
<HTML>
<HEAD>
<TITLE>Create a New Article</TITLE>
<%
' These script files initialize the EditLive! API so that the EditLive!
' properties and methods may be set to customise EditLive!.
%>
<SCRIPT language="JavaScript1.2"
src="../../editlive/editLive4.js"></SCRIPT>
<SCRIPT language="VBScript"
src="../../editlive/editLive4.vbs"></SCRIPT>
</HEAD>
<BODY>
<%
' Instantiate the EditLive! object on your web page using client-side
JavaScript
%>
<SCRIPT LANGUAGE="JavaScript">
//Important: set the directory where EditLive! download files can be
found
EditLiveGlobal.setDownloadDirectory("../../editlive/");
//Create the EditLive! object
var editLive1 = new EditLive("Plugin1", "100%",
300);
//Assign an onload function to initialize the properties and methods
editLive1.onload = EditLive1_onload;
//This function specifies the initial EditLive! properties and methods
function EditLive1_onload()
{
// Set the user interface to database mode
editLive1.setEditLiveMode('HTMLString');
// Set the image mode to allow image insertion from the server only
editLive1.setImageMode('ServerOnly');
// Initialize the FTP server (for images)
editLive1.setFTPServer('ftp.ephox.com');
editLive1.setFTPServerPort(21);
editLive1.setFTPUsername('anon');
editLive1.setFTPPassword('anon');
// Set the base URL to render relative image addresses
editLive1.setWebRoot('http://www.ephox.com/ftp/');
// (Optional) Load the initial contents of the document's BODY element
editLive1.setSource(" ");
// (Optional) Load the initial contents of the document's STYLE element
//editLive1.setStyleElementText("H1 {font-size:16pt}");
}
</SCRIPT>
</BODY>
</HTML> |
Step 2 - Add a heading to the page of "Create a New
Article".
<BODY>
<H1>Create a New Article</H1> |
Step 3 - Create a form in the page around the EditLive! object.
Enter the processing file name, xt_add.asp, in the action attribute of the FORM
tag.
<%
' This form contains EditLive!, a text area for the article title,
' a submit button and a cancel button.
%>
<FORM action="xt_add.asp"
method="POST"
name="articleForm">
<%
'This area contains the code that initiates EditLive!
%>
</FORM> |
Step 4 - Add a text field at the beginning of the form for the article
title.
<%'
Article title %>
<P>Title:
<INPUT type="text"
name="article_title"
size="50"></P> |
Step 5 -Add two buttons to the end of the form; a submit button to
save the article to the database and a cancel button to return the browser to
the index page without saving.
<P>
<INPUT type="submit"
value="Save"
name="Add Article">
<INPUT type="button"
value="Cancel"
name="Cancel"
onclick="javascript:history.back();">
</P> |
Step 6 - Add two hidden form objects to store the contents of
EditLive! and the style element within EditLive! for processing.
<%'
Hidden fields for storing content from EditLive! %>
<INPUT type="hidden"
name="article_body">
<INPUT type="hidden"
name="article_styleElementText"> |
Step 7 - Create a function to retrieve the contents of EditLive! and
pass it to the hidden form object, and to get the style element for the content
within EditLive! and pass it to the other hidden form object.
/* This
function gets the contents out of EditLive! and
assigns it to a hidden form field when the Submit button is pressed. */
function articleForm_onSubmit()
{
document.articleForm.article_body.value =
editLive1.getSource();
document.articleForm.article_styleElementText.value =
editLive1.getStyleElementText();
} |
Step 8 - Call this function in the onsubmit event of the FORM tag.
| <FORM
action="xt_add.asp"
method="POST"
name="articleForm"
onsubmit="articleForm_onSubmit()"> |
Xt_add.asp
Step 1 - Include the i_adovbs.asp and i_database.asp files to connect
to the database.
<%
' Include I_DATABASE.ASP which defines the database connection
' Include I_ADOVBS.ASP which defines ADO constants.
%>
<!--#INCLUDE FILE="i_database.asp"-->
<!--#INCLUDE FILE="i_adovbs.asp"--> |
Step 2 - Create a connection to the database and create a new
recordset to add the new article.
<%
' Instantiate an ADO Connection object
Set objDBConn=
Server.CreateObject("ADODB.Connection")
' Open the connection using the connection string
' defined in the included file "i_database.asp"
objDBConn.Open strConnection
' Instantiate an ADO Recordset object
Set rsArticle =
Server.CreateObject("ADODB.Recordset")
' Set the type of cursor we will use
rsArticle.CursorType = adOpenKeyset
' Set the lock type for the records so that only when we update
' a record is that record locked by ADO
rsArticle.LockType =
adLockOptimistic
' Open the articles table
rsArticle.Open "articles", objDBConn, , , adCmdTable |
Step 3 - Add a new record to the recordset.
' Add a
new record
rsArticle.AddNew |
Step 4 - Assign the values of the form objects to the relevant
recordset fields.
' Set the
values
If Request.Form("article_title") <> "" Then
rsArticle("article_title") =
Request.Form("article_title")
End If
If Request.Form("article_body") <> "" Then
rsArticle("article_body") =
Request.Form("article_body")
End If
If Request.Form("article_styleElementText") <>
"" Then
rsArticle("article_styleElementText") =
Request.Form("article_styleElementText")
End If |
Step 5 - Save the new record to the database.
' Save
the record
rsArticle.Update |
Step 6 - Destroy the database objects.
' Destroy
the objects
rsArticle.Close
objDBConn.Close
Set rsArticle = Nothing
Set objDBConn =
Nothing |
Step 7 - Redirect the web browser back to the index page.
' Go back
to the start page
Response.Redirect("start.asp") |
Purpose - The file edit.asp loads an existing article into EditLive!
for modification. Once the article is complete, the relevant record in the
database is updated using the processing page, xt_edit.asp.
Edit.asp
Step 1 - Again, start with a standard HTML page containing EditLive!
running in HTMLString mode. To see the steps involved in creating this
page please see Using EditLive! with an Online
Database or in an Online Form.
<HTML>
<HEAD>
<TITLE>Edit an Article</TITLE>
<%
' These script files initialize the EditLive! API so that the EditLive!
' properties and methods may be set to customise EditLive!.
%>
<SCRIPT language="JavaScript1.2"
src="../../editlive/editLive4.js"></SCRIPT>
<SCRIPT language="VBScript"
src="../../editlive/editLive4.vbs"></SCRIPT>
</HEAD>
<BODY>
<%
' Instantiate the EditLive! object on your web page using client-side
JavaScript
%>
<SCRIPT LANGUAGE="JavaScript">
//Important: set the directory where EditLive! download files can be
found
EditLiveGlobal.setDownloadDirectory("../../editlive/");
//Create the EditLive! object
var editLive1 = new EditLive("Plugin1", "100%",
300);
//Assign an onload function to initialize the properties and methods
editLive1.onload = EditLive1_onload;
//This function specifies the initial EditLive! properties and methods
function EditLive1_onload()
{
// Set the user interface to database mode
editLive1.setEditLiveMode('HTMLString');
// Set the image mode to allow inserting images only from the server
editLive1.setImageMode('ServerOnly');
// Initialize the FTP server (for images)
editLive1.setFTPServer('ftp.ephox.com');
editLive1.setFTPServerPort(21);
editLive1.setFTPUsername('anon');
editLive1.setFTPPassword('anon');
// Set the base URL to render relative image addresses
editLive1.setWebRoot('http://www.ephox.com/ftp/');
// (Optional) Load the initial contents of the document's BODY element
editLive1.setSource(" ");
// (Optional) Load the initial contents of the document's STYLE element
//editLive1.setStyleElementText("H1 {font-size:16pt}");
}
</SCRIPT>
</BODY>
</HTML> |
Step 2 - Add a heading to the page of "Edit Document".
<BODY>
<H1>Edit Document</H1> |
Step 3 - Create a form in the page around the EditLive! object.
Enter the processing file name, xt_edit.asp, in the action attribute of the FORM
tag.
<%
' This form contains EditLive!, a text area for the article title,
' a submit button and a cancel button.
%>
<FORM name="form1"
method="post"
action="xt_edit.asp">
<%
'This area contains the code that initiates EditLive!
%>
</FORM> |
Step 4 - Add Save and Cancel buttons to the form, the same as for the
add.asp page.
| <P><INPUT
type="submit"
value="Save">
<INPUT type="button"
value="Cancel"
onclick="javascript:history.back();"></P> |
Step 5 - Include the i_adovbs.asp and i_database.asp files to connect
to the database.
<%
' Include I_DATABASE.ASP which defines the database connection
' Include I_ADOVBS.ASP which defines ADO constants.
%>
<!--#INCLUDE FILE="i_database.asp"-->
<!--#INCLUDE FILE="i_adovbs.asp |
Step 6 - Create a connection to the database.
'
Instantiate an ADO Connection object
Set objDBConn=
Server.CreateObject("ADODB.Connection")
' Open the connection using the connection string
' defined in the included file "i_database.asp"
objDBConn.Open strConnection |
Step 7 -Create a recordset containing the article information for the
specified article_id.
' Define
the SQL query
strCommandText = "SELECT * FROM articles WHERE article_id = "
& Request.QueryString("article_id")
' Retrieve the recordset
Set rsArticle = objDBConn.Execute(strCommandText, , adCmdText) |
Step 8 - Assign the article information to set variables, ensuring
that the HTML is encoded.
If Not
rsArticle.BOF Then
' The record is found
' Article ID
lngArticleID = rsArticle("article_id")
' The article title
If rsArticle("article_title").ActualSize > 0 Then
' Encode the title in case it contains HTML tags
strArticleTitle =
Server.HTMLEncode(rsArticle("article_title"))
Else
strArticleTitle = ""
End If
' The article's STYLE attribute
If rsArticle("article_styleElementText").ActualSize > 0
Then
strArticleStyleElementText =
Server.HTMLEncode(rsArticle("article_styleElementText"))
Else
strArticleStyleElementText = ""
End If
' The article's body text
If rsArticle("article_body").ActualSize > 0 Then
strArticleBody =
Server.HTMLEncode(rsArticle("article_body"))
Else
strArticleBody = ""
End If |
Step 9 - Create a text area for the article title and give it the
initial value of the article title variable defined in Step 8.
<%'
Article title %>
<P>Title: <INPUT
type="text"
name="article_title"
value="<%=strArticleTitle%>"
size="40"></P> |
Step 10 - Create hidden form objects for the other article information
and give them all the initial values of the article variables defined in Step 8.
<%'
Hidden field for identifying the article %>
<INPUT type="hidden"
name="article_id"
value="<%=lngArticleID%>">
<%' Hidden fields for loading and storing content in EditLive!
%>
<INPUT type="hidden"
name="article_styleElementText"
value="<%=strArticleStyleElementText%>">
<INPUT type="hidden"
name="article_body"
value="<%=strArticleBody%>"> |
Step 11 - Change the arguments of the EditLive! setSource and
setStyleElementText properties to load the existing article information into
EditLive!.
// Load
the contents of the document's STYLE element
editLive1.setStyleElementText(document.forms.form1.article_styleElementText.value);
// Load the contents of the document's BODY element
editLive1.setSource(document.forms.form1.article_body.value); |
Step 12 - Add a function to the form to retrieve the contents and
style information from EditLive! and assign it back to the hidden form objects
when the Save button is pressed.
// This
function gets the contents out of EditLive! and
// assigns it to a hidden form field when the Submit button is pressed.
function form1_onsubmit()
{
document.forms.form1.article_body.value =
editLive1.getSource();
document.forms.form1.article_styleElementText.value =
editLive1.getStyleElementText();
return true;
} |
Step 13 - Call this function in the onsubmit event of the FORM tag.
| <FORM
name="form1"
method="post"
action="xt_edit.asp"
onsubmit="return
form1_onsubmit()"> |
Xt_edit.asp
Step 1 - Include the i_adovbs.asp and i_database.asp files to connect
to the database.
<%
' Include I_DATABASE.ASP which defines the database connection
' Include I_ADOVBS.ASP which defines ADO constants.
%>
<!--#INCLUDE FILE="i_database.asp"-->
<!--#INCLUDE FILE="i_adovbs.asp"--> |
Step 2 - Create a connection to the database and create a new
recordset to update the article information in the database.
<%
' Instantiate an ADO Connection object
Set objDBConn=
Server.CreateObject("ADODB.Connection")
' Open the connection using the connection string
' defined in the included file "i_database.asp"
objDBConn.Open strConnection
' Instantiate an ADO Recordset object
Set rsArticle =
Server.CreateObject("ADODB.Recordset")
' Set the type of cursor we will use
rsArticle.CursorType = adOpenKeyset
' Set the lock type for the records so that only when we update
' a record is that record locked by ADO
rsArticle.LockType =
adLockOptimistic
' Open the articles table
rsArticle.Open "articles", objDBConn, , , adCmdTable |
Step 3 - Select the current record to be deleted from the database so
that the new information can be saved.
' Select
the record to delete
rsArticle.Filter = "article_id = " &
Request.Form("article_id") |
Step 4 - Update the recordset fields with the information from the
form objects.
| If Not
rsArticle.BOF Then
' Update the fields
rsArticle("article_title") =
Request.Form("article_title")
rsArticle("article_body") = Request.Form("article_body")
rsArticle("article_styleElementText") =
Request.Form("article_styleElementText") |
Step 5 - Save the new record to the database.
' Save
the record
rsArticle.Update |
Step 6 - Destroy the database objects.
' Destroy
the objects
rsArticle.Close
objDBConn.Close
Set rsArticle = Nothing
Set objDBConn =
Nothing |
Step 7 - Redirect the web browser back to the index page.
' Go back
to the start page
Response.Redirect("start.asp") |
Purpose - The file delete.asp displays the chosen article information
to allow the user to confirm that they wish to delete the specified
article. Once confirmation is obtained, the relevant record in the
database is deleted using the processing page, xt_delete.asp.
Delete.asp
Step 1 - Start with a standard HTML page add give it the heading
"Delete a Document" and a message asking the user if they wish to
delete the article.
<BODY>
<H1>Delete a Document</H1>
<P>Are you sure you wish to
delete this article?</P>
</BODY>
</HTML> |
Step 2 - Include the i_adovbs.asp and i_database.asp files to connect
to the database.
<%
' Include I_DATABASE.ASP which defines the database connection
' Include I_ADOVBS.ASP which defines ADO constants.
%>
<!--#INCLUDE FILE="i_database.asp"-->
<!--#INCLUDE FILE="i_adovbs.asp"--> |
Step 3 - Create a connection to the database.
'
Instantiate an ADO Connection object
Set objDBConn=
Server.CreateObject("ADODB.Connection")
' Open the connection using the connection string
' defined in the included file "i_database.asp"
objDBConn.Open strConnection |
Step 4 -Create a recordset containing the article information for the
specified article_id
' Define
the SQL query
strCommandText = "SELECT * FROM articles WHERE article_id = "
& Request.QueryString("article_id")
' Retrieve the recordset
Set rsArticle = objDBConn.Execute(strCommandText, , adCmdText) |
Step 5 - Assign the article id and title to set variables, ensuring
that the HTML in the article title is encoded.
If Not
rsArticle.BOF Then
' The record is found
' Article ID
lngArticleID =
rsArticle("article_id")
' The article title
If rsArticle("article_title").ActualSize > 0 Then
' Encode the title in case it contains HTML tags
strArticleTitle =
Server.HTMLEncode(rsArticle("article_title"))
Else
strArticleTitle = ""
End If |
Step 6 - Create a table in the HTML page that displays the article id
and title using the variables defined in Step 5.
<TABLE>
<%' Article ID %>
<TR>
<TD>Article ID:</TD>
<TD><%=lngArticleID%></TD>
</TR>
<%' Article title %>
<TR>
<TD>Title:</TD>
<TD><%=strArticleTitle%></TD>
</TR>
</TABLE> |
Step 7 - Create a form in the page that includes buttons to Delete the
article or cancel the deletion. Put the xt_delete.asp file name in the action
attribute of the FORM tag.
<%'
Form for deleting the article %>
<FORM action="xt_delete.asp"
method="GET">
<P><INPUT type="submit"
value="Delete">
<INPUT type="button"
value="Cancel"
onclick="javascript:history.back();"></P>
</FORM> |
Step 8 - Add a hidden form object to the form to store the article id
for processing.
| <INPUT
type="hidden"
name="article_id"
value="<%=lngArticleID%>"> |
Xt_delete.asp
Step 1 - Include the i_adovbs.asp and i_database.asp files to connect
to the database.
<%
' Include I_DATABASE.ASP which defines the database connection
' Include I_ADOVBS.ASP which defines ADO constants.
%>
<!--#INCLUDE FILE="i_database.asp"-->
<!--#INCLUDE FILE="i_adovbs.asp"--> |
Step 2 - Create a connection to the database.
<%
' Instantiate an ADO Connection object
Set objDBConn=
Server.CreateObject("ADODB.Connection")
' Open the connection using the connection string
' defined in the included file "i_database.asp"
objDBConn.Open strConnection' |
Step 3 - Create the SQL statement to delete the article from the
database.
' Create
a command text string
strCommandText= "DELETE * FROM articles WHERE article_id = "
& Request.QueryString("article_id") |
Step 4 - Delete the record.
' Delete
the record
objDBConn.Execute(strCommandText) |
Step 5 - Close the database connection.
' Close
the connection
objDBConn.Close
Set objDBConn = Nothing |
Step 6 - Redirect the web browser back to the index page.
' Go back
to the start page
Response.Redirect("start.asp") |
Viewing an Article (view.asp)
Purpose - The file view.asp displays the chosen article.
Step 1 -Start with a standard HTML page and iInclude the i_adovbs.asp
and i_database.asp files to connect to the database.
<%
' Include I_DATABASE.ASP which defines the database connection
' Include I_ADOVBS.ASP which defines ADO constants.
%>
<!--#INCLUDE FILE="i_database.asp"-->
<!--#INCLUDE FILE="i_adovbs.asp"-->
<HTML>
<HEAD>
</HEAD>
<BODY>
</BODY>
</HTML> |
Step 2 - Create a connection to the database and create a new
recordset to retrieve the article information from the database.
<%
' Instantiate an ADO Connection object
Set objDBConn=
Server.CreateObject("ADODB.Connection")
' Open the connection using the connection string
' defined in the included file "i_database.asp"
objDBConn.Open strConnection
' Instantiate an ADO Recordset object
Set rsArticle =
Server.CreateObject("ADODB.Recordset") |
Step 3 - Use embedded ASP to set the STYLE tag of the page to the
article style information retrieved from the database and to display the article
title and content.
<HTML>
<HEAD>
<TITLE><%=rsArticle("article_title")%></TITLE>
<STYLE>
<%=rsArticle("article_styleElementText")%>
</STYLE>
</HEAD>
<BODY>
<H1><%=rsArticle("article_title")%></H1>
<%=rsArticle("article_body")%>
</BODY>
</HTML> |
Step 4 - Close the database connection and destroy the database
objects.
' Destroy
the objects
rsArticle.Close
objDBConn.Close
Set rsArticle = Nothing
Set objDBConn =
Nothing |
|