Wrox Home  
Search

Topic: ASP.NET

Beginning Active Server Pages 3.0 (0764543636) cover image

Beginning Active Server Pages 3.0

David Buser, John Kauffman, Juan T. Llibre, Brian Francis, Dave Sussman, Chris Ullman, Jon Duckett
ISBN: 978-0-7645-4363-0
Paperback
1248 pages
July 2000
This title is out-of-print and not currently available for purchase from this site.


Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
General typos and other glitches

Page 16: the grey background is missing in the highlighted code in first edition books.
Page 24, point 4a the word "in" is missing from between "Check" and "the"
Page 206: we state that our code will calculate a date three weeks in advance, but in our code we only set a date 14 days ahead, not 21.
207: Line 11, substitute "a" in place of the second "are" in "By assigning the value to this variable, we are running are function."
Page 209: our code for FunctionResponse.asp works fine, but it fails to include car-hire costs for the expenses for suburban visitors.
Page 311: The word "be" is missing in the third sentence of the first paragraph under the heading "Important Note about Global.asa causing errors".

16-Mar-00 1
35 Error in figure

In some editions of this book, the first figure of page 35 displays an error: namely that the top folder in the left-hand pane of that figure reads Documents and Settings. It should, of course, read Inetpub.

Thanks to Chris Lawrence.

23-Oct-01 1
65 Incorrect caption in figure

In some editions of this book, step (5) of the figure on page 65 reads 'HTML stream passed back to server'.

It should read 'HTML stream passed back to client'.

Thanks to Chris Lawrence.

23-Oct-01 1
66 Server-side not Client-side

2nd Bullet Item under "Writing Server-Side Scripts": Last Sentence: should say "... is treated as a non-ASP server-side script"

16-Apr-02 1
68 Incorrect filename in Step 2

On page 68, Step 2 should instruct you to save your file to the Inetpub\wwwroot\BegASPFiles directory, not Inetpub\wwwroot\BegASP.

Thanks to Chris Lawrence.

23-Oct-01 1
75 DataConf1.asp

Page 75 - Try It Out ~ Step 1 notes that this is quite similar to DateConf2.asp when actually it's more like DateConf1.asp.

23-Apr-02 1
76 Incorrect filename in Step 2

On page 76, Step 2 should instruct you to save your file to the Inetpub\wwwroot\BegASPFiles directory, not Inetpub\wwwroot\BegASP.

Thanks to Chris Lawrence.

23-Oct-01 1
78 Capitalized Jscript

The Jscript in Date config4.htm contains the line:

Document.Write (d);

This is incorrect. It should be lower case, as in:

document.write (d);

This is probably a result of editing documents in Word, which tries to spell-check any quoted code. Our appologies.

16-Mar-00 1
83 remove semicolon
In the listing in Chapter 2 for ExecOrder3.asp, the page would not display using either IE6 or NS6 until the ; after the ASP statements was removed. The code shows: <% Response.Write ("Line 6: Second ASP line<br>"); %> But only works as <% Response.Write ("Line 6: Second ASP line<br>") %> In 3 places.
7/25/02 1
92 Server not client

Page 92 - Summary ~ Second Paragraph ~ Last Sentence states: "This new web page is returned to the server as HTML, which the browser then processes in order to create the page display that we see on the screen." In context, I believe it should have been stated as: "This new web page is returned to the client as HTML, which the browser then processes in order to create the page display that we see on the screen."

23-Apr-02 1
125 typo

August 2000 Reprint page 125, Second Paragraph, 3rd Line

Currently: "One of the things we can do with that syntax is use it top assign the associated...."

Should Read: "One of the things we can do with that syntax is use it to assign the associated..."

23-Sep-02 1
140 Modulus and \

In the arithmetic calculations section, the book describes Modulus as MOD or \ This is not the case. MOD returns the remainder after division. \ returns the integer portion of the answer after division.

25-Jul-02 1
145 Wrong description of CInt

Alex Alexander has supplied this errata. A correction was made in the August 2001 edition:

The description of CInt should read, "...and rounds it to the nearest whole number. When rounding a number like 0.5, 1.5, 2.5 (where the rounding could be up or down), CInt rounds to the nearest even number. "

31-Aug-01 1
150 End Proc should be End Sub

This error was supplied by Panu M??ntylahti.

In the subprocedure blocks of code at the foot of the page, it should be 'End Sub' and not 'End Proc'

Corrected in the February/March 2001 reprint.

14-Feb-01 1
161 Additional quotes

Page 161: Code about 3/4 the way down the page reads, strMarx(5) = "Karl""

Should read:
strMarx(5) = "Karl"" ' do not need the extra quotes

22-Oct-02 1
162 Misnumbering of array members

The first piece of quoted code contains a misnumbering of the array members on either side of the assignment. intEmployeePay[0] should only be reassigned to intEmployeePay[0] + intExtraPay, and so on. Mistakes like this are another good reason it's best to loop through the array, as in the next code segment, rather than using separate assignments.

16-Mar-00 1
162 Incorrect loop counter variable name.

This error was supplied by Steve Mallet.

The following code:

<samp>
intExtraPay = 10
For intCounter = 1 to 5
intEmployee(intLoop) = intEmployeePay(intLoop) + intExtraPay
Next</samp>

It should read:

<samp>
intExtraPay = 10
For intLoop = 1 to 5
intEmployee(intLoop) = intEmployeePay(intLoop) + intExtraPay
Next
</samp>

Corrected in the August 2000 reprint.

14-Feb-01 1
166 Multi-dimensioned array indexes out of order.

This error was supplied by Hugh Poynor.

Multi-dimensioned array indexes out of order. In the code:

<samp>
str2Darray(0,0)= "John"
str2Darray(0,1)= "Doe"
etc</samp>

the column index is always listed first in VB. The example illustrates facts about people (name, ssn) but people represent records (rows) in VB The example should read as follows:

<samp>
str2Darray(0,0)= "John"
str2Darray(1,0)= "Doe"
etc
</samp>

The proof can be found by using the recordset method getrows.

Corrected in the February/March 2001 reprint.

14-Feb-01 1
177 Testing for greater/less than

If Then ElseIf End if Example text, page 177 Nov 2000 reprint: tests for > and < 18, and > < 65 - should be >= or <= otherwise age 18 and 65 are omitted

23-Apr-02 1
178 Month not MonthPref

Error in instructions on page 178 chapter 5. Should read:- varMonthPref = Request.Form("Month") NOT varMonthPref = Request.Form("MonthPref")

25-Jul-02 1
185 Incorrect value name passed

Wonderful book, you actually make learning *.asp fun, or then again I could
be a "sad case", as my wife puts it.

Anyway I am up to pg 185: <select name="Month"> in #1
seems to conflict with
varMonthPref =
Request.Form("MonthPref") in#3
should read
varMonthPref =
Request.Form("Month")

All the best

Paul Joseph

16-Mar-00 1
187 Incorrect comparison

The last highlighted code block on page 187 purports to be equivalent to the highlighted code block that immediately preceeds it - it isn't. To be equivalent the second comparison should read varDatePref >= 16 rather than varDatePref >=30.

16-Mar-00 1
190 Name in FORM ACTION attribute is wrong.

This error was supplied by Venky Naravulu.

The line
<samp><FORM ACTION="TioForNextOneResponse.asp" ..."> </samp>
should read as
<samp><FORM ACTION="ForNextOneResponse.asp" ..."> </samp>

Corrected by the February/March 2001 reprint.

14-Feb-01 1
190 Missing inverted commas

lines 9--11, the <INPUT TYPE=TEXT ... > Should read <INPUT TYPE="TEXT" ... >

25-Jul-02 1
193 Incorrect text on page

Thanks to all readers who submitted this error which has been corrected in later editions

varDateThisLine =varStart+varLineCounter-1

should be

varDateThisLine =varStart+varLineCounter

since varLineCounter starts from 0.

14-Jun-01 1
196 zero should be one

On page 196, line # 4 says: value of zero since we have no rows printed so far... Change the word "zero" to "one".

23-Apr-02 1
196 varMonthNow

On page 196, line # 10 (not counting the blank line) says: done if the varMonthCount is less than the MonthNow (which would be 5 ... Change the word "MonthNow" to "varMonthNow".

23-Apr-02 1
209 Wrong variable name

Vivek Agarwal supplied this errata that was corrected on August 2001.

On page 209 and page 211 suburbCost should be varHotelTotal+varMealsTotal+varCarTotal instead of varHotelTotal+ varMealsTotal

31-Aug-01 1
226 Possible installation problems of MyTelephone
??

Some readers have reported difficulties with the installation of the MyTelephone sample. If this is the case, try the following.

Instead of *executing* MyTelephone.exe, simply open it using WinZip (or other zipping software). Then extract all of the contents to a folder. Then run setup.exe as normal (setup.exe just registers the .dlls so that your ASP file can call them).

If you still have problems, try this. The file that is created is called MyTelephone.dll. It can be placed in any directory - the only important thing is that the file be registered in that directory. To do that, there is a file called REGSVR32.EXE. If you run that file and pass the name of the .dll as a parameter (e.g. regsvr32 MyTelephone.dll), it will register the file in that location. The best way to do this is from the command prompt: copy the .dll file to the desired directory, go to that directory, and then run regsvr32 MyTelephone.dll. The OS should find regsvr32.exe since it is usually in the windows/system folder, which is in the path.

26-Jan-00 1
253 Incorrect Querystring name

In some editions of this book, the fifth gray code-block on page 253 refers to
<%= Request.QueryString('name')%>.
It should, of course, refer to
<%= Request.QueryString('username')%>

Thanks to Jack Montealegre

30-Oct-01 1
258 Incorrect text on page

The error was supplied by Odd K Auestad

Text under the first gray box should read:

Here, Request.Querystring("HolidayLocation")(1) holds...

Text under the second gray box should read:

Here, Request.Querystring("HolidayLocation")(2) holds...

The second line on page 259 should read:
"HolidayLocation=Madrid&...

and there is no "final line of the script" with the text in the gray box.

Corrected in the February/March 2001 reprint.

14-Feb-01 1
268 bread not data

There is an error on page 268, instead of Response.Write MidB(data, i, 1) should be Response.Write MidB(bread, i, 1)

23-Apr-02 1
270 firstname and lastname

Where it says "name=Chris&name=Ullman &pass=secret" Should say: "firstname=Chris&lastname=Ullman &password=secret"

22-Oct-02 1
279 Incorrect Response.Redirect Syntax

This error was supplied by Philip Babazadeh:
The following line:
<samp><% Response.Redirect = Destination Page %></samp>

should actually read:
<samp><% Response.Redirect "Destination Page" %>
</samp>

08-Feb-01 1
284 Repeated Text in Try it Out

The error was supplied by Peter Neville:

The first paragraph in Step 1 of the Try It Out has been repeated from the Try It Out on page 280 and doesn't make sense where it is. It's meant to be saying something along the lines of "Open your HTML editor, create a new file, and type in the following".

Corrected in the February/March 2001 reprint

14-Feb-01 1
284 Relative vs Absolute URLs

In the Nov 2000 reprint, the 3rd paragraph starts with "In both cases, the value of DestinationPage..." The very last sentence in the paragraph is plainly incorrect based on http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q247420& The page returns a "Invalid URL form or fully-qualified absolute URL was used. Use relative URLs" when using http:// So the Server.Execute and Server.Transfer methods can only be used locally.

22-Oct-02 1
286 Reference to wrong Appendix

This error was supplied by Steve Boswell.

The reference to Appendix C at the bottom of page 286 should be a reference to Appendix A.

Error Corrected in the February/March 2001 reprint.

14-Feb-01 1
294 Error in the HasKeys Property Example

The error was supplied by Steve Mallet.

In the "The HasKeys
Property" topic, the first code fragment that follows the text "...multiple
values, we interrogate the HasKeys property:

<samp>Response.Cookies("theCookie").HasKeys"</samp>

should read

<samp>Request.Cookies("theCookie").HasKeys</samp>

Corrected in the February/March 2000 reprint

14-Feb-01 1
298 Missing parentheses

This errata was supplied by Stefan Zafirov - correct in the Aug 2001 reprint

Response.Redirect "checklogin.asp?cookie=1"
should be
Response.Redirect("checklogin.asp?cookie=1")

31-Aug-01 1
306 Missing quotes around the Application.Contents parameter

This error was supplied by Jeff Moritz

On the last line of the highlighted text near the bottom of the page under the topic, "Remove Method", should have quotes around the "FirstVariable" parameter, as in:
Application.Contents.Remove("FirstVariable")

Similarly, on page 317, the last highlighted line under the "Remove Method" topic also requires quotes around the "FirstVariable" parameter, as in: Session.Contents.Remove("FirstVariable")

Corrected in the February/March 2001 reprint

14-Feb-01 1
307 Page Caching in IE 6.0

I found that the "click here" link actually retrieved the page from the
browser cache rather than reloading it. Consequently, the application
variables did not change. I would recommend that you add the following to
the page so that the "click here" link will work as intended;

<%Response.Expires = 0 %>

12-Dec-01 1
314 Code errors

The example in gray at the top of page 314 contains numerous errors. There are 6 items. The line numbers that I refer to assume that line #1 is "<%" which is the first line of the example. A)Line #4 ends in: ... Can't display object" & "
") Although the above will work, the code is awkward. Better code: ... Can't display object
") B)Line #7 ends in: ... & Session.Content(item) It should be: ... & Session.Contents(item) C)Every instance of "objArray" should be changed to something else, because these are not objects. Thus it confuses the student when you use the "obj" prefix. I used "itmArray" in the code shown below, but feel free to use any nomenclature as long as you don't use "obj". D)Line #12 is indented incorrectly. It would be more readable if the first "R" in "Response.write" were lined up beneath the capital "N" in line #11. E)Line #14 is indented incorrectly. It would be more readable if the first "R" in "Response.write" were lined up beneath the capital "N" in line #11. F)Line #15 is indented incorrectly. It would be more readable if you shift the whole line to the left by one column so that the capital "E" of "End if" is lined up beneath the capital "E" of "Else" in line #13.

<html>
<head>
<title>examine session variables</title>
</head>
<body>
<%
for each item in session.contents
 if isObject(session.contents(item)) then
   response.write item & ": can't display object<br>"
 else
   if isArray(session.contents(item)) then
     response.write "Array: " & item & "<br>"
     for each itmArray in session.contents(item)
       response.write "<li>" & itmArray
       'response.write "<li>" & session.contents(item)(ii)
     next
     response.write "<br>"
   else
     response.write item & ": " & session.contents(item) & "<br>"
   end if
 end if
next
%>
</body>
</html>

Note that line #15 of my code is commented out (the only comment in the code). In programming there is usually more than one way to skin a cat.  If you uncomment line #15, comment out line #14, and add 2 additional lines:
  ii = 0   'place this after line #12
  ii = ii + 1   'place this after line #15 (before the "next" command)
then this program will function exactly the same.  Thus you have a choice; use subscripts or not.  Either way, the program functions the same.  I prefer avoiding the subscripts because it saves two lines of code.
23-Apr-02 1
320 Comparing to empty string

page 320 of Chapter 8: In the first line of the second gray rectangle, tAccessTime should be compared with an empty string "" rather than with a string containing one space " ". The former gives you the desired result by showing that this page was just accessed, while the former will give you the second message displaing a blank data/time.

23-Apr-02 1
325 Incorrect Screen Print

Page 325, step 11. The screen print is incorrect (the screen shown belongs with an example covered previously in the chapter, and has nothing to do with the current example). Our apologies for this error which will corrected in the next re-print.

Thanks to Matthew B. Merrill

17-Jan-00 1
332 Incorrect figure

In the picture under number 4. It appears as follows: 4. <HTML> ..... <HTML> I think that it should be 4. <HTML> ..... </HTML> The "/" is missing

25-Jul-02 1
379 Wrong object name

This errata was supplied by Kevin Yank and corrected in the August 2001 edition

The first aside (indented, italicized text) referes to an instantion
of 'objRegExp', when in fact the code it refers to instantiates the
Dictionary class as 'objDictionary'.

31-Aug-01 1
380 Lemon

The first Try-It-Out in Chapter #10 of Beginning ASP Pages 3.0 (Published Aug. 2000) Line one: The variable 'strKey' is not needed for the code to work. I tried the code as published and it failed. Line twelve: This is where strKey is assigned the value "Lemon", but the objDictionary already has "Lemon" added with additional information pertaining to 'Lemon', in this case 'Yellow' By referring to the new value of strKey, the additional information, 'Yellow' doesn't show. Actually the code is not accessing the stored data in the Dictionary object. I fixed this by simply removing 'strKey from the code entirely. Also, on the last two lines of code before the ending ASP deliminater the code should read as follows: strValue = objDictionary.Item("Lemon") Response.Write "Value stored with key of 'Lemon' is " & strValue Not: strKey = "Lemon" strValue = objDictionary.Item("strKey") Response.Write "Value stored with key of '" & strKey & "' is " & strValue

25-Jul-02 1
386 Code doesn't match the description

Roger Sleight provided this errata which was corrected in the August 2001 edition

On page 386 the description of the two For Each loops says that they use the
Keys and Items methods when they don???t.

For Each key in objDictionary
Response.Write ???<P>Key = ??? & key & ??? ??? Value = ??? & objDictionary.Item(key)
Next

For Each item in objDictionary
Response.Write ???<P>Value = ??? & objDictionary(item)
Next
---
The following accomplishes the same thing using the Keys and Items methods.

For Each key in objDictionary.Keys
Response.Write "<P>Key = " & key & " -- Value = " &
objDictionary.Item(key)
Next

For Each item in objDictionary.Items
Response.Write "<P>Value = " & item
Next

31-Aug-01 1
389 Example won't work with Norton Anti Virus

David Barbella supplied this helpful information:

This Relates to Chapter 10 - the FileSystemObject section.
The first Try It Out Example beginning on page 389 to 391.

If you have Norton Anti-Virus 2001 on your server, the Try It Out may not
work for you.
A recent update added Script Blocking to the checking it does.
Unfortunately this causes a conflict with the FSO (especially when
writing/creating) as it thinks it is viral activity, yet all it does is
lockup the browser/server. You need to disable this in the NAV options, and
then you will have to reboot (even though it doesn't mention you need to).

Script Blocking enabled will cause your server to hang, and force you to
reboot your server.

31-Aug-01 1
390 Wrong Server Variable

Susan E Davis supplied the following errata which was corrected in the August 2001 edition

On page 390 in the source code there is a line that reads:

strPathInfo = Request.ServerVariables("SCRIPT_NAME")

should read:

strPathInfo = Request.ServerVariables("PATH_INFO")

31-Aug-01 1
400 Extraneous backslash

Kevin Yank supplied the following errata which was corrected in the August 2001 edition.

On the first line, the leading backslash of the 'file' attribute's
value ("\TextFiles\MyFile.txt") should be removed. As-is, this code causes a
500.100 error (ASP 0130 error), since physical-path server-side includes may
not begin with a backslash. Removing the backslash ("TextFiles\MyFile.txt")
would make the code work as described in the text surrounding it.

31-Aug-01 1
418 URL no longer exists

Page 418 tells readers to download a text file from http://webdev.wrox.co.uk which no longer exists. The text file is now a part of the code download for the book and you should find it in there. If not then you can cut and paste it from here, and name the new file textfile.txt:

<% strSearch="LUKE<BR>How did my father die?<BR>BEN<BR>A young Jedi named Darth Vader, who was a pupil of mine until he turned to evil, helped the Empire hunt down and destroy the Jedi Knights. He betrayed and murdered your father. Now the Jedi are all but extinct. Vader was seduced by the dark side of the Force.<BR>LUKE<BR>The Force?<BR>BEN<BR>Well, the Force is what gives a Jedi his power. It's an energy field created by all living things. It surrounds us and penetrates us. It binds the galaxy together.<BR>Artoo makes beeping sounds.<BR>BEN<BR>Now, let's see if we can't figure out what you are, my little friend. And where you come from.<BR>LUKE<BR>I saw part of the message he was...<BR> Luke is cut short as the recorded image of the beautiful young Rebel princess is projected from Artoo's face.<BR>BEN<BR>I seem to have found it.<BR>Luke stops his work as the lovely girl's image flickers before his eyes.<BR>LEIA<BR>General Kenobi, years ago you served my father in the Clone Wars. Now he begs you to help him in his struggle against the Empire. I regret that I am unable to present my father's request to you in person, but my ship has fallen under attack and I'm afraid my mission to bring you to Alderaan has failed. I have placed information vital to the survival of the Rebellion into the memory systems of this R2 unit. My father will know how to retrieve it. You must see this droid safely delivered to him on Alderaan. This is our most desperate hour. Help me, Obi-Wan Kenobi, you're my only hope. <BR>There is a little static and the transmission is cut short. Old Ben leans back and scratches his head. He silently puffs on a tarnished chrome water pipe. Luke has stars in his eyes.<BR> <BR>BEN<BR>You must learn the ways of the Force if you're to come with me to Alderaan.<BR>LUKE<BR> <BR> (laughing)<BR>Alderaan? I'm not going to Alderaan. I've got to go home. It's late, I'm in for it as it is.<BR>BEN<BR>I need your help, Luke. She needs your help. I'm getting too old for this sort of thing.<BR>LUKE<BR>I can't get involved! I've got work to do! It's not that I like the Empire. I hate it! But there's nothing I can do about it right now. It's such a long way from here.<BR>BEN<BR>That's your uncle talking.<BR>LUKE<BR> <BR> (sighing)<BR>Oh, God, my uncle. How am I ever going to explain this? <BR><BR>BEN<BR>Learn about the Force, Luke.<BR>"%>
03-Sep-02 1
430 xtraneous <HTML> <BODY> tags in AdRotatorHome.asp

The error was supplied by Peter Neville

In the Try It Out, step 4 creating the AdRotatorRedirector.asp has <HTML> & <BODY> tags in it. With these tags in the code, when I run AdRotatorHomePage.asp and click on one of the ads I get the following error
*********************
Response object error 'ASP 0156 : 80004005'
Header Error
/begasp/AdRotatorRedirector.asp, line 19
The HTTP headers are already written to the client browser. Any HTTP header
modifications must be made before writing page content.
*******************************
Without the tags the code works as expected.

Corrected in the February/March 2001 reprint

14-Feb-01 1
442 Incorrect filename

About 3/4 of the way down the page it says: "Open the index file, NewProductsTour.txt".

This should be:
"Open the index file, CL-NewProductsTour.txt"

17-Dec-01 1
455 Do NOT use ASPtracker.com

The domain name ASPTracker.com is no longer maintained by Juan Llibre, but has been purchased by site of a rather more unsavory nature. Please do not use it. If you want an updated version of the browscap.zip file, we will be placing it on this site shortly.

Chris

16-Jul-01 1
469 Error in figure

On page 469 of some editions, the second bos in the figure contains the caption OLE-DB. It should contain the caption ADO.

Thanks to Chris Lawrence.

23-Oct-01 1
472 Where to get MSDE

Page 472 states if you have a copy of Microsoft Visual Studion, then you can download MSDE free from the Microsoft website at http://msdn.microsoft.com/vstudio/mdse This address is incorrect - I found the download file at http://microsoft.com/downloads/release.asp?ReleaseID=30652

19-Sep-02 1
512 Table on page 512

The text states that there's an asterisk beside the table representing the position of the cursor. This asterisk is missing. It should be beside the last record in the table, John Morrisey's.

Our thanks to James Simpson for bringing this to our attention.

-----Original Message-----
From: James Simpson
sent: 29 June 2000 17:33
To: support@wrox.com
Subject: Beginning ASP 3.0


I have a question on this book on page 512. The bottom table shows a
recordset with three records. The sentence right above it states "In the
following table, the asterisk (*) on the left-hand side indicated the
position of the cursor:"

My table does not have ANY asterisk(*) at all. The bottom/right phone
number is in bold though.

Am I just confused?

Simpson

03-Jul-00 1
513 Recordset object

In the run-up to the Try It Out section on page 515, an assignment:

Set objRS = Server. CreateObject("ADODB.Connection")

... is shown. This, of course, should be:

Set objRS = Server. CreateObject("ADODB.Recordset")

In the actual Try It Out section and in the explanation that follows, this mistake isn't made, but nevertheless we apologise for the misleading intro.

15-Jul-02 1
524 Dynamic recordset not cursor

PG 524 Second sentence

"You can think of a dynamic cursor as a "window" onto the data in the database."

I believe this should say:

"You can think of a dynamic RECORDSET as a "window" INTO the data in the database."

09-Jan-02 1
531 No closing tag

David Barbella supplied this errata which was corrected in the August 2001 edition

On page 531 (Chapter 13, Try it out, Moving Through Records)

strOutputString = "<table border = 1>" &_
"<tr><td width=""30%""><b>Director</b></td>" &_
"<td><b>Film<b></td></tr>"

The Closing Bold tag after Film is missing the closing bracket.
<b>Film<b>
Should be:
<b>Film</b>

31-Aug-01 1
548 Incorrect HTML tags

Brian McGuire supplied this errata that was corrected in the August 2001 edition p. 548, Line 24 ("<TABLE BORDER=1> <TR> <TD><B>Film<B></TD> <TD>Director</TD> </TR>" would work better if changed to: "<TABLE BORDER=1> <TR> <TD><B>Film</B></TD> <TD><B>Director</B></TD> </TR>"

31-Aug-01 1
558 Unintuitive use of GetRows Method

The error was supplied by Greg Nordstrom.

Although the GetRows Method code on pg. 557-558 works as written, the use of the intLastCol and intLastRow variables is somewhat confusing. Swapping these two variables eliminates the confusion, as shown below:

<samp>
' now use the array to display the data
intLastCol = UBound(avarFields, 1)
intLastRow = UBound(avarFields, 2)
For intRow = 0 To intLastRow ' loop through the array
For intCol = 0 to intLastCol
</samp>

This variable confusion is also reflected in the code description on pg. 559, center page gray box, which should read:

<samp>
intLastCol = UBound(avarFields, 1)
intLastRow = UBound(avarFields, 2)
</samp>

(Note that the line of text immediately preceeding these two lines on pg. 559 correctly indicates that the first dimension of the array is columns, and the second is rows.)

Corrected in the February/March 2001 reprint.

14-Feb-01 1
592 Wrong constant supplied

Wayne Feltham supplied this errata which was corrected in the August 2001 edition

In the example of setting objParam properties.

objParam.Direction = adInput' - USES WRONG CONSTANT (MISSING 'Param')!

Should read:
'objParam.Direction = adParamInput'

31-Aug-01 1
600 Incorrect CursorType supplied to database.

This error was supplied by Simon Jackson.

The line which reads:

<samp> objRS.Open "Movies", strConnect, adOpenStatic, adLockOptimistic, adCmdTable </samp>

(line 17 I think in the example)

caused a run time error.

Change it to:

<samp> objRS.Open "Address", strConnect, adOpenDynamic, adLockOptimistic, adCmdTable </samp>

and the page will work.

Corrected in the February/March 2000 reprint.

23-Apr-02 1
607 Adding global variables

FindByDirector.asp code (ch. 14, p.607-8) work properly without adding the following declarations: Dim adOpenForwardOnly, adLockReadOnly, adCmdTable, adCmdText adOpenForwardOnly = 0 adLockReadOnly = 1 adCmdTable = 2 adCmdText = 1 Kept receiving "undefined variable 'adOpenForwardOnly'" error without it, despite following the code word for word.

23-Apr-02 1
607 Change to SQL statement

John Stienen provided the following errata which was corrected in the August 2001 edition

While the source code reads:
strSQL = strSQL & " WHERE Director LIKE '" & Request.Form("Director") & "'"

it wouldn't work if the database was in random order. This piece of code would however:

strSQL = strSQL & " WHERE Director LIKE '%" & Request.Form("Director") &
"%'"

31-Aug-01 1
626 Typo - remove 8'

There is a typo in the code on page 626. The line which reads: objStream.Open "URL=" & strURLofBackup, adModeReadWrite, 8'adOpenStreamFromURL should of course have the "8'" removed as it is a typo.

objStream.Open "URL=" & strURLofBackup, adModeReadWrite, adOpenStreamFromURL
03-Jul-02 1
659 Missing redirect information

This errata was supplied by Deirdre Dixon.

Page 659,paragraph 4, mentions that the Login.asp file should "redirect the user to Register.asp?NotFound="True" - and we use the querystring variable called NotFound to tailor the message accordingly."

The link listed at bottom of page should read:
"<TD WIDTH=33%><A HREF="Register.asp?NotFound=True">I'm a
new user</A></TD>

23-Apr-02 1
661 Incorrect Form variable names

This error was supplied by Avril Jones.

In Building an Application, the wrong field names are given on p. 661 and on p. 662, the wrong
database file name.

Lines 21 & 22 of AddUser.asp:

<samp> rsUsers("FamilyName") = Request.Form("FamilyName")
rsUsers("GivenName") = Request.Form("GivenName")</samp>

In Classified_97.mdb, these fields are actually called "Surname" and "FirstName"

Also, in Clssfd.asp, line 7, database file name is given as Classified.mdb. It should be either Classified_2000.mdb or Classified_97.mdb.

14-Feb-01 1
662 </H3> not </H1>

5 lines from bottom of page
<H3>Welcome <%= Session("GivenName") %></H1>

HTML heading tags need to match, should close with </H3>.

06-Dec-01 1
668 Problem with login.asp

There is a problem with the way login.asp is presented by later versions of Internet Explorer. You should substitute the code in the book for the following:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<BASEFONT FACE="Comic Sans MS" COLOR="DarkBlue">
<HTML>
<HEAD>
<TITLE>WROX Classifieds - Login</TITLE>
</HEAD>

<BODY BGCOLOR="#FFFF80">
<CENTER><H1>WROX Classifieds<BR>Login</H1></CENTER>
<P>
<% If Request("Again") = "1" then
  if Request("BadPW") = "True" then %>
    Invalid Password<BR>
  <% Else  %>
    E-Mail Address not found.  Try again<BR>
  <% End If %>
<% End If %>
Please enter your e-mail address and password to login to the system.
<FORM ACTION="CheckLogin.asp<% If Request("Again") = "1" then %>?Again=1<% End If %>" METHOD="POST">
<TABLE BORDER=0>
  <TR>
    <TD>E-Mail Address:</TD>
    <TD><INPUT TYPE="Text" NAME="email" <% If Request("Again") = "1" then %> VALUE="<%= Session("EMailAddress") %>"<% End If %> SIZE="40"></TD>
  </TR>
  <TR>
    <TD>Password:</TD>
    <TD><INPUT TYPE="Password" NAME="Password" SIZE="40"></TD>
  </TR>
  <TR>
    <TD></TD>
    <TD align=center><INPUT TYPE="Submit" VALUE="Login">&nbsp;&nbsp;<INPUT TYPE="RESET"></TD>
  </TR>
</TABLE>
</FORM>

<HR>
<TABLE BORDER=0 width=100%>
  <TR align=center>
    <TD width=33%><A HREF="browse.asp">Browse the listings</A></TD>
    <TD width=33%>Login</TD>
    <TD width=33%><A HREF="register.asp">I'm a new user</A></TD>
  </TR>
</TABLE>

</BODY>
</HTML>
02-Sep-02 1
695 Name redefined (or a typo) in AddNew.asp

Some readers have experienced the following error on line 3 of AddNew.asp:

Microsoft VBScript compilation error '800a0411'
Name redefined
/asp/AddBid.asp, line 3
Dim objCmd, rsHighBid, strSQL, varHighBid


If you get this error, it is because the variable strSQL is defined twice within the page AddBid.asp: once within the SSI file clssfd.asp that is #INCLUDE'd into AddBid.asp (see page 662), and once on line 3 of AddBid.asp itself (see page 695). The solution is to remove the second definition of strSQL from line 3 of AddBid.asp, so it reads thus:

Dim objCmd, rsHighBid, varHighBid

The source code and later reprints of this book will contain the correct code at this line.


Incidentally, earlier print runs of the book also contain a typo at this line (on page 695):

Dim objCmd, rsHighBid, srtSQL, varHighBid

Again, if you have this code then you should tidy it by removing the definition altogether:

Dim objCmd, rsHighBid, varHighBid

Thanks to Paul Wu

07-Apr-00 1
718 Wrong text describing screenshot

Mike Kabala supplied this errata which was corrected in the August 2001 edition

On page 718, the text of step 7 states that the screen shot is that of a
login page, but the page displayed in the illustration is really a seller's
detail frame. The text should describe the seller's detail frame

31-Aug-01 1
733 Wrong DLL name

Liang EE Hand supplied the following errata which was corrected in the August 2001 edition

objscr.dll shall be scrobj.dll

31-Aug-01 1
744 Missing line in code example

The code example on page 744 is missing the line:

Set objCarpetPricer = Nothing

Before the End If statement at the end of the script.

06-Dec-01 1
748 One method instead of two

Bill Teisher supplied this errata which was corrected in the August 2001 edition

The book says: "Now we'll declare the single method that will be exposed by this component, and its parameters." However, page 748 seems to conflict, indicating that the "component will.. expose two methods." The two methods indicated on pg 748 are named DepositCheck and WriteCheck, and the method on pg 752 is named AddMoney. Page 748 should only descibe one method AddMoney that takes two parameters

31-Aug-01 1
761 closing tags

The error was supplied by Hubert Talib.

There are two mistakes here (I compare it from the code that I downloaded) which cause code error:

1.)there is no closing tag for the <BODY> tag
2.)on line 34 from the code I found that there is no
bracket on the following statement

<samp>blnSuccess = objSourceAcct.AddMoney -dblAmtToTransfer,
intCheckNum</samp>

where it supposed to be like this

<samp>blnSuccess = objSourceAcct.AddMoney
(-dblAmtToTransfer, intCheckNum)</samp>

1)Corrected in the February/March 2001 reprint.
2)Corrected in the August 2000 reprint.

23-Apr-02 1
779 If Then

In Beginning Active Server Pages 3.0, ISBN 1-861003-38-2, on page 779 it says: <%@ TRANSACTION=Required %> <html> Dim objA, objB Set objA = Server.CreateObject("mydll.myclass") Set objB = Server.CreateObject("mydll.myclass") If Not ObjA.Go = 0 Then Object.Context.SetAbort It seems to me that the second to last line of code above should say: If ObjA.Go = 0 rather than If Not... Then because you are testing for failure, not success. A few lines of code below this, the test for objB is: ElseIf ObjB.Go = 0 Then Object.Context.SetAbort

23-Apr-02 1
785 DB connection

The connection to the database Bank has to be established before the first encounter of ObjectContex.SetAbort (where the reason of abort is "Can't transfer funds when the source and destiantion account are the same"), so that the variable dcBank would not be empty when OnTransactionAbort{} event handler fires. Sub onTransactionAbort() Response.Write "&tl;HR>" & _ "Transaction Aborted
" & _ "Reason: " & strAbortReason & _ "&tl;HR>[ <A HREF='bankHome.asp'>Write Another Check</A> ]" & _ "&tl;/BODY>" & _ "&tl;/HTML>" 'Here dcBank would be Empty if the connection to the database is not established by this moment. If Not dcBank Is Nothing Then If dcBank.State = adStateOpen Then dcBank.Close End If Set dcBank = Nothing End If End Sub

23-Apr-02 1
801 Variables not passed

Peter Chen supplied this errata, which was corrected in the August 2001 edition

On page 801 in the code for "SetBalance.asp", two variables
" strAcctNo, dblInitialBalance " are not defined and assigned any value in this page. Thus the "register" table in the database will be filled with wrong empty data even though you get the seemingly correct outcome on the page "BankAddAccount.asp". One of the correct way is to set those two as Session variables, and the pass them as Session("strAcctNo"), and Session("dblInitialBalance") throughout the following pages

31-Aug-01 1
815 Wrong variable name

Liang EE Hang supplied this errata which was corrected in the August 2001 edition

The variable bSuccess & ... should be ...& blnSuccess &.

31-Aug-01 1
841 External DTD needs lines removing from it

The error was supplied by Barry Godsmark.

The '>' is missing from end of second line of DTD example.

The first and last lines of this example DTD should be omitted in an external DTD file.

This text works ok when included directly in the xml file but fails when used as an external DTD. Refer page 451 of Professional ASP 3.0.

Corrected in the February/March 2001 reprint.

14-Feb-01 1
843 missing file, books.dtd

There is a missing file in the code download, books.dtd. Here it is:

<!DOCTYPE books [
<!ELEMENT books (book+)>
<!ELEMENT book (title, ISBN, authors, description?, price+)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT authors (author+)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT price EMPTY>
<!ATTLIST price
          US        CDATA        #REQUIRED
>
]>
25-Nov-02 4
847 Typo in the style sheet code

This error was supplied by K Xie

In the "Try it Out"/shaded section, there's a typo. Under the title{} block, "font-weight" is spelled "font-wieght". Minor typo, but still important to the code.

Error corrected in February/March 2001 reprint

14-Feb-01 1
902 Things that Microsoft changed in Win2K during book publication

Appendix B
We've been wrongfooted by changes between Release Candidates and the Gold
Code Windows 2000.

On page 902 we have 'Network' defined as 3, with a comment stating this
isn't predefined. It's now in the type library, but as 'Remote'.

On Pages 904, the one of the Attributes values is now different.
'Alias' is now defined as 1024.

16-Mar-00 1
1030 Incorrect object

Farooq Karim supplied this errata which was corrected in the August 2001 edition.

Line No. : 8 (Point # 7)

In point 7 you wrote:

"Using POST and looking for data in the Response.QueryString (POST data goes into the Forms collection)"

Solution:

the underlined words should be replaced by Request.QueryString

31-Aug-01 1
1037 "Welcome" in Swahili

The correct spelling for the swahili equivalent of "Welcome" is "Karibu".

03-Sep-02 1
1058 Incorrect variable value

This error was supplied by Kevin Smith.

In Appendix F on page 1058: Filename should be LoopingData01Form.asp. It currently reads:

<samp> varback = "LoopingData01-1-Form.asp" </samp>

This should be:

<samp> varback = "LoopingData01Form.asp" </samp>

Corrected in the August 2000 reprint.

14-Feb-01 1
1130 IISRESET not IISRESTART

This error was supplied by Rick Roth.

In Appendix I, references to the iisrestart utility are incorrect. The command is actually iisreset.

Corrected in the February/March 2001 reprint.

14-Feb-01 1
1158 URL

"URL" is not Universal Resource Locator as shown on page 1158 in the glossary. It is Uniform Resource Locator.

23-Apr-02 1
1192 Index entry for passing data between pages

On Page 1192 Under the bold-print "Session Object" Refers to an item "data, passing between pages, 329" Page 318 is the correct page number ?

22-Oct-02 1
1193 Index errata

Session_Onend and Session_OnStart are not discussed on pages 332 and 337 as indexed. Both are covered on page 321, instead.

29-Aug-00 1
Printer-Ready Version   Share This
With you wherever you go: pdf + ePub + kindle -- DRM-free