Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

  • Print
  • + Share This
From the author of

Server Scripting Languages

The next step is to create the server-generated page that will connect to the database and extract the content that will be presented to Flash. For this article I am using Microsoft's ASP technology.

You will need to have access to a Microsoft Internet Information Server (IIS). This is the application server that translates the ASP code we write.

You need to create a website on the server. If you are unfamiliar with how to do this, contact your local ISP.

Place the Access database that you have just created within the root of the new website on Microsoft Internet Information Server.

Open Notepad or your favorite text editor and type the following code:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim MM_connstr_STRING
MM_connstr_STRING = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
       Server.MapPath("usability.mdb")
Dim rsUsability
Dim rsUsability_numRows
Set rsUsability = Server.CreateObject("ADODB.Recordset")
rsUsability.ActiveConnection = MM_connstr_STRING
rsUsability.Source = "SELECT * FROM RandomRec ORDER BY Statement ASC"
rsUsability.CursorType = 0
rsUsability.CursorLocation = 2
rsUsability.LockType = 1
rsUsability.Open()
rsUsability_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rsUsability_numRows = rsUsability_numRows + Repeat1__numRows
%>
<% 
While ((Repeat1__numRows <> 0) AND (NOT rsUsability.EOF)) 
%>
<%=(rsUsability.Fields.Item("Statement").Value)%><BR><BR> 
<% 
 Repeat1__index=Repeat1__index+1
 Repeat1__numRows=Repeat1__numRows-1
 rsUsability.MoveNext()
Wend
%>
<%
rsUsability.Close()
Set rsUsability = Nothing
%>

Save the page as usability.asp. The script opens up a connection with the Usability database, retrieves the correct data out of the table RadmonRec, and repeats all of the rows of data.

Preview this page through the Web browser (see Figure 3). You should be able to view all of the data from the database.

Figure 3Figure 3 Here you can see the ASP page displaying content. Later, this information will be pulled into Flash.

The next step is to load this data directly into Flash.

  • + Share This
  • 🔖 Save To Your Account