Active Server Pages 3.0 From Scratch

Errata

Can't get Personal Web Server to work while off the Internet? Try this.
Listing 2.2
Listng 2.14
Listing 3.22
Listing 3.23
Listing 3.24
Listings 4.5 and 4.6
Listing 4.14
Listing 4.14
Listing 4.15
Listing 4.16
Listing 4.17
Listing 4.19
Listing 4.19a
Listing 5.3
Listings 5.10, 5.11
Listing 5.12
isting 5.23
Listing 5.27
Listing 6.16
Listing 6.26
Listing 6.27
Listing 7.6
Listing 7.8
Listing 7.15
Listing 7.29
Page 281
ContentRotator or other component errors


Listing 2.2

The lines:

13:<A href="news/news.asp">News</A>
14:<BR>15:<A href="news/archives.asp">Archives</A>
16:<BR>

should read:

13:<A href="news/news.asp">News</A>
14:<BR>
15:<A href="news/archives.asp">Archives</A>
16:<BR>


Listing 2.14

The line:

11:<% if Weekday(Now) = vbSatrday then

should read

11:<% if Weekday(Now) = vbSaturday then


Listing 3.22

"news/archiveslist.txt"

should read

"/news/archiveslist.txt"


Listing 3.23

The line:

9: <% next %>10:

should read

9: <% next %>
10:


Listing 3.24

The lines:

4: <H1>Outpost Archives</H1> 5: <% set myTOC =
Server.CreateObject("MSWC.NextLink") %>

should read

4: <H1>Outpost Archives</H1>
5: <% set myTOC = Server.CreateObject("MSWC.NextLink") %>


Listings 4.5 and 4.6

The line:

8: <FORM ACTIONFORM ACTION="/take_registration.asp">

should read

8: <FORM ACTION="/take_registration.asp">


Listing 4.14

Lines

10: set outpostDB = Server.CreateObject("ADODB.Connection")
11:
12: theSQL = "insert into members "

should read

10: set outpostDB = Server.CreateObject("ADODB.Connection")
11: outpostDB.open "outpost"
12: theSQL = "insert into members "


Listing 4.14

Line

22: theSQL = "insert into userid_medium (userid, medium) values ('"&p_userid&"', '"&p_medium&"')"

should read

22: theSQL = "insert into user_medium (userid, medium) values ('"&p_userid&"', '"&p_medium&"')"


Listing 4.15

Line

7: p_pass2 = request.querystring ("p_pass2")...

should read

7: p_pass2 = request.querystring ("p_pass2")
...


Listing 4.16

Lines

42:<% else %>
43:
44: 'There was a problem with their registration
45:
46: <h2>Problem</h2>

should read

42:<% else
43:
44: 'There was a problem with their registration %>
45:
46: <h2>Problem</h2>


Listing 4.17

Lines

26: for each p_medium in Request.form("p_medium")
27: theSQL = "insert into userid_medium (userid, medium) values ('"
28: theSQL = theSQL & p_userid &"', '"&p_medium&"')"

should read

26: for each p_medium in Request.querystring("p_medium")
27: theSQL = "insert into user_medium (userid, medium) values ('"
28: theSQL = theSQL & p_userid &"', '"&p_medium&"')"

and lines

43:<% else %>
44:
45: 'There was a problem with their registration
46:
47: <h2>Problem</h2>

should read

43:<% else
44:
45: 'There was a problem with their registration %>
46:
47: <h2>Problem</h2>


Listing 4.19

Line

27: theSQL = "insert into userid_medium (userid, medium) values ('"

should read

27: theSQL = "insert into user_medium (userid, medium) values ('"

and lines

43:<% else %>
44:
45: 'There was a problem with their registration
46:
47: <h2>Problem</h2>

should read

43:<% else
44:
45: 'There was a problem with their registration %>
46:
47: <h2>Problem</h2>


Listing 4.19a

Line

27: theSQL = "insert into userid_medium (userid, medium) values ('"

should read

27: theSQL = "insert into user_medium (userid, medium) values ('"

and line

33: set outpostDB. = Nothing

should read

33: set outpostDB. = Nothing
...


Listing 5.3

Line

0: <%@ LANGUAGE="VBSCRIPT" %>1: <% if Request.cookies.count = 0 then

should read

0: <%@ LANGUAGE="VBSCRIPT" %>
1: <% if Request.cookies.count = 0 then


Listings 5.10 and 5.11

Line

11: Response.Redirect " /login.asp?retry=username"

should read

11: Response.Redirect "/login.asp?retry=username"

and line

20: Response.Redirect " /login.asp?retry=password"

should read

20: Response.Redirect "/login.asp?retry=password"


Listing 5.12

line

12: <% elseif Request.querystring("") = "username" then %>

should read

12: <% elseif Request.querystring("retry") = "username" then %>

and lines

29: <H2><%= RRequest.cookies("isLoggedInAs") %>'s Personal Space</H2>
30:
31: If you are not <%= RRequest.cookies("isLoggedInAs") %>,

should read

29: <H2><%= Request.cookies("isLoggedInAs") %>'s Personal Space</H2>
30:
31: If you are not <%= Request.cookies("isLoggedInAs") %>,


Listing 5.23

Line

25: & "where username = '" _& p_username & "' order by link_id")

should be

25: & "where username = '" & p_username & "' order by link_id")


Listing 5.27

Line

55: & " where username = 0: '" & p_username & "' order by news_cat_id")

should read

55: & " where username = '" & p_username & "' order by news_cat_id")


Listing 6.16

Line

64: </TABLE>65:

should read

64: </TABLE>
65:


Listing 6.26

Line

7: Set Session ("arrTo")=SServer.CreateObject("Scripting.Dictionary")

should read

7: Set Session ("arrTo")=Server.CreateObject("Scripting.Dictionary")


Listing 6.27

Line

54: & " members where 5username = '"&p_lastbidder&"'")

should read

54: & " members where username = '"&p_lastbidder&"'")


Listing 7.6

Line

48: Request.Write catSet("cat_id") 8%>&p_cat_name=<%

should read

48: Request.Write catSet("cat_id") %>&p_cat_name=<%


Listing 7.8

Line

0: <%\\@ LANGUAGE="VBSCRIPT" %>

should read

0: <%@ LANGUAGE="VBSCRIPT" %>

and line

22: Resoinse.Write Server.URLencode(catSet("cat_name"))%>">

should read

22: Response.Write Server.URLencode(catSet("cat_name"))%>">


Listing 7.15

Line

15:<TABLE<TABLE WIDTH=""75%"">

should read

15:<TABLE WIDTH="75%">


Listing 7.29

Line

51: Server.Transfer " /bazaar/baz_order_review.asp"

should read

51: Server.Transfer "/bazaar/baz_order_review.asp"


Page 281

The text:

By using Server.Redirect instead, the server retreives the new page and feeds it to the browser, which thinks it's still at the old URL.

should read

By using Server.Transfer instead, the server retreives the new page and feeds it to the browser, which thinks it's still at the old URL.


ContentRotator or other component errors

Active Server Pages 3.0 From Scratch was written for Internet Information Services 5.0, but all components mentioned exist in version 4.0. Unfortunately, not all of them are included with all versions of IIS or Personal Web Server. If you are unable to create a component object such as Content Rotator, you may not have the component installed. The files included on the CD show you which lines to comment out to prevent this error (by not using the component).

Additionally, some components (specifically Content Rotator) can be found in the IIS 4.0 Resource Kit, which can be found on the Microsoft Developer's Network CD. If this is the version you are using, you will need to substitute:

set randomNews = Server.Createobject("IISSample.ContentRotator")

for

set randomNews = Server.Createobject("MSWC.ContentRotator")

We are trying to locate a site to download any missing components, and will update this information when we do. If you have any information on where to find Content Rotator or other components, or if you want us to let you know when we find them, please write to aspfs@nicholaschase.com.