 |
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4  | This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040 |
Please indicate which version of the book you are using when posting questions. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

November 19th, 2009, 12:06 PM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 19
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
only 1 record showing
When displaying {all} events, only 1 shows (page 430 figure 12-8).
When I test the "connection", I get 3 entries (not the {many} entries shown in the book).
How do I get all {3} entries to show.
I'm pretty sure I did the lesson per the book and since Dreamweaver adds unexplained code I don't know where to start looking.
Please advise.
Thanks, Tracey
Beginning Dreamweaver MX 2004
ISBN 0-7645-5524-3 (not 4) 762 pages (not 792 pages)
copyright 2004... 10 9 8 7 6 5 4 3
__________________
Tracey
|
|

November 19th, 2009, 12:14 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hard to tell. Could be a problem with the database (is your query using a JOIN?), or maybe you're missing a loop somewhere?
Please provide more info, such as the records in your database and the ASP code that shows them....
Imar
|
|

November 20th, 2009, 09:16 AM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 19
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
Below is the code from the events.asp file.
The properties of the TheSoccerSite.mdb file show a size of 364,544 bytes (as downloaded from Wrox website).
I " tested" the connTheSoccerSite connection which lists 3 records, but the Dreamweaver MX2004 test-connection dialog box has no capacity to copy&paste the text.
Thanks, Tracey
BTW:
Is your TheSoccerSite.mdb 364,544 bytes long?
If so, does your/Wrox's 364,544 byte TheSoccerSite.mdb file have 3 items in it?
Or is your/Wrox's TheSoccerSite.mdb file different?
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/connTheSoccerSite.asp" -->
<%
Dim rsEvents
Dim rsEvents_numRows
Set rsEvents = Server.CreateObject("ADODB.Recordset")
rsEvents.ActiveConnection = MM_connTheSoccerSite_STRING
rsEvents.Source = "SELECT EndDate, StartDate, Summary, Title FROM Events ORDER BY StartDate ASC"
rsEvents.CursorType = 0
rsEvents.CursorLocation = 2
rsEvents.LockType = 1
rsEvents.Open()
rsEvents_numRows = 0
%>
<!--#include file="Tools/functions.asp"-->
<% SetFirstVisitedPage() %>
<%
Dim sSelected
Dim iLastCategory
If Request.QueryString("lstCategory") <> "" Then
' Category has been chosen, so let's save it in a cookie
iLastCategory=Request.QueryString("lstCategory")
Response.Cookies("LastCategory")=iLastCategory
Response.Cookies("LastCategory").Expires=Date()+1
Else
' Page is requested directly, so get the cookie
If Len(Request.Cookies("LastCategory")) > 0 Then
iLastCategory=CInt(Request.Cookies("LastCategory"))
End If
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoDateTime(str, nNamedFormat, nLCID)
dim strRet
dim nOldLCID
strRet = str
If (nLCID > -1) Then
oldLCID = Session.LCID
End If
On Error Resume Next
If (nLCID > -1) Then
Session.LCID = nLCID
End If
If ((nLCID < 0) Or (Session.LCID = nLCID)) Then
strRet = FormatDateTime(str, nNamedFormat)
End If
If (nLCID > -1) Then
Session.LCID = oldLCID
End If
DoDateTime = strRet
End Function
</SCRIPT>
<html ><!-- InstanceBegin template="/Templates/mainTemplate.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>GlobalSoccerEvents.com - Your Source for Soccer Events Around the Globe</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<%
Dim sBackgroundColor
If Len(Request.Cookies("BackgroundColor")) > 0 Then
sBackgroundColor = Request.Cookies("BackgroundColor")
Else
sBackgroundColor = "#ffffff" ' Our default background color
End If
Dim iTheme
If Len(Request.Cookies("SiteTheme")) > 0 Then
iTheme = Request.Cookies("SiteTheme")
Else
iTheme = 1 ' Our default theme
End If
Dim sBadge
If Len(Request.Cookies("SelectedBadge")) > 0 Then
sBadge=Request.Cookies("SelectedBadge")
Else
sBadge="logo" 'Our default logo
End If
%>
<link href="Styles/mainStyles.css" rel="stylesheet" type="text/css" />
<link href="Styles/mainStyles<% Response.Write(iTheme) %>.css" rel="stylesheet" type="text/css" />
</head>
<body style="background-color: <% Response.Write(sBackgroundColor) %>"><!-- #BeginLibraryItem "/Library/mainMenu.lbi" --><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/<% Response.Write(sBadge) %>.gif" alt="The Soccer Site Logo" name="imgDefaultBadge" id="imgDefaultBadge" /></td>
<td>
<table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td><a href="home.asp" id="home">Home</a></td>
<td> </td>
<td><a href="events.asp" id="events">Events</a></td>
<td> </td>
<%
MM_authorizedUsers="Administrators"
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
%>
<td><a href="Admin/admin.asp" id="admin"><strong>Admin</strong></a></td>
<td> </td>
<%
End If
End If
%>
<%
MM_authorizedUsers="Administrators,Members"
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
%>
<td><a href="mysite.asp" id="mysite">My Site</a></td>
<td> </td>
<%
End If
End If
%>
<td><a href="login.asp" id="login"><strong>Login</strong></a></td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<script language="JavaScript" type="text/javascript">
var sPageName='<% Response.Write(Request.ServerVariables("SCRIPT_NAME"))%>';
sPageName=sPageName.substr(sPageName.lastIndexOf('/')+1).toLowerCase();
sPageName=sPageName.substr(0, sPageName.lastIndexOf('.'));
if (document.getElementById(sPageName))
{
document.getElementById(sPageName).style.fontWeight='Bold';
document.getElementById(sPageName).style.fontSize='14pt';
}
</script>
<!-- #EndLibraryItem --><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><h2>
<!-- InstanceBeginEditable name="title" -->Current Events <!-- InstanceEndEditable -->
</h2></td>
</tr>
<tr>
<td>
<!-- InstanceBeginEditable name="content" -->
<form action="events.asp" method="get" name="frmSelectCategory" id="frmSelectCategory">
<select name="lstCategory" size="1" id="lstCategory" onchange="document.frmSelectCategory.submit();">
<option value="">Select a Category</option>
<% If iLastCategory=1 Then sSelected=" selected=""selected""" Else sSelected=""%>
<option value="1">Champions League</option>
<% If iLastCategory=2 Then sSelected=" selected=""selected""" Else sSelected=""%>
<option value="2">UEFA Cup</option>
<% If iLastCategory=3 Then sSelected=" selected=""selected""" Else sSelected=""%>
<option value="3">National League</option>
<% If iLastCategory=4 Then sSelected=" selected=""selected""" Else sSelected=""%>
<option value="4">US Major League Soccer</option>
</select>
<table width="600" border="1" cellspacing="2" cellpadding="2">
<tr>
<td class="clsHeading"><%=(rsEvents.Fields.Item("Title").Value)%></td>
</tr>
<tr>
<td class="clsSummary"><%=(rsEvents.Fields.Item("Summary").Value)%></td>
</tr>
<tr>
<td>This event will last from <%= DoDateTime((rsEvents.Fields.Item("StartDate").Value), 1, 1033) %> until <%=(rsEvents.Fields.Item("EndDate").Value)%></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</form>
<!-- InstanceEndEditable -->
</td>
</tr>
<tr>
<td><p align="center">
<br />
<br />
<br />
<!-- InstanceBeginEditable name="footer" --><!-- InstanceEndEditable -->
<br />
<br />
<br />
</p>
</td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
<%
rsEvents.Close()
Set rsEvents = Nothing
%>
__________________
Tracey
|
|

November 20th, 2009, 09:24 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Did you forget step 8 at page 429 that adds a Repeat region? I don't see that anywhere in your code (you should end up with a While look that checks the Repeat1__numRows variabkle....)
Imar
|
|

November 21st, 2009, 11:37 AM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 19
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
You can STOP!!! working on this issue... at least for now
Yes I KNOW I DID ALL the steps...
But I now see step 6 missing (which I know I did) and step 7 is there, so something must have gotten whacked in the process or in the interim
Thanks, Tracey
PS I downloaded a MDBViewer and see 18 records in the events tab of the TheSoccerSite.mdb file 
__________________
Tracey
|
|

November 30th, 2009, 01:08 PM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 19
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
I discovered something with this issue!
In the downloaded code, the END of chapter 11 and the START of chapter 12 only have 3 events records in their respective TheSoccerSite.mdb files
After NOT being able to resolve my issues  , I deleted my local and remote/test-site and copied the START of chapter 12 and tried to start over. I tested my db connection and only 3 records/entries appear.
After re-booting I deleted my local and remote/test-site again and copied the END of chapter 11. I tested my db connection and only 3 records/entries appear. I rebooted again.
I then opened up the TheSoccerSite.mdb file (with a MDBViewer) in the END of chapter 12 and all 18 records/entries appear.
I used the MDBViewer to open each of the 10 mdb files and found that all the other TheSoccerSite.mdb files have 18 records/entries.
I ended up just copying the END of chapter 12's mdb file to the local and remote/test-site and All records now appear.
I sure hope you correct this issue!!!
__________________
Tracey
|
|

November 30th, 2009, 03:44 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
I sure hope you correct this issue!!!
|
What issue exactly? I mean, what do you want me to fix? If I recall correctly (the book is many years old), the records are added while building the site..... But I could be wrong.....
Imar
|
|

November 30th, 2009, 05:38 PM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 19
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
To answer your question:
since the book shows records that are not in the TheSoccerSite.mdb file (chapter 12 step 9) which gave me an indication that something was wrong
and the book (at least up to this point) does not appear to make provision to update the TheSoccerSite.mdb file
and the downloads are still available (sincerely, thank you very much for not removing them  )
Suggestions would be:
add the missing records to the TheSoccerSite.mdb file in the chapters7_13.zip file for the applicable chapters
or
Create a note (a readme.txt file) indicating which TheSoccerSite.mdb file to use for the applicable chapters.
or
At least create a note (a readme.txt file) in chapters7_13.zip that states records are missing from the TheSoccerSite.mdb file in the applicable chapters in an effort to not confuse the students.
Thanks, Tracey
Just FYI: TheSoccerSite.mdb 364,544 bytes compresses to 93%.
The following are compressed sizes as TheSoccerSite.mdb appears in chapters7_13.zip or "555243 WhyNotTry Exercises.zip" as applicable:
24,584 Chapter 11 End
24,584 Chapter 12 Start
25,813 Chapter 12 End
25,813 Chapter 13 Start
25,659 Chapter 13 End
25,659 Final
25,701 WNTE1302
25,191 WNTE1303
If they are all suppose to be the same size then you can see which mdb files have an issue 
__________________
Tracey
|
|

November 30th, 2009, 05:43 PM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 19
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
(To continue on with my real/original issue)
Even though I now have 18 records in the events file, I still have the issue of only 1 record showing
Are (steps 6 through 8) supposed to work in Dreamweaver MX2K4 or are the following issues bugs in Dreamweaver MX2K4?
Please advise.
Thanks, Tracey
I completed step 6, but Dreamweaver MX2K4 does NOT retain step 6
I completed step 7, but Dreamweaver MX2K4 refuses to apply a date format to the "rsEvents EndDate" (claiming I am trying to update an un-editable region)
I completed step 8, but Dreamweaver MX2K4 still only shows 1 record.
(again, claiming I am trying to update an un-editable region)
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/connTheSoccerSite.asp" -->
<%
Dim rsEvents
Dim rsEvents_numRows
Set rsEvents = Server.CreateObject("ADODB.Recordset")
rsEvents.ActiveConnection = MM_connTheSoccerSite_STRING
rsEvents.Source = "SELECT EndDate, ID, StartDate, Summary, Title FROM Events ORDER BY StartDate ASC"
rsEvents.CursorType = 0
rsEvents.CursorLocation = 2
rsEvents.LockType = 1
rsEvents.Open()
rsEvents_numRows = 0
%>
<!--#include file="Tools/functions.asp"-->
<% SetFirstVisitedPage() %>
<%
Dim iLastCategory
If Request.QueryString("lstCategory") <> "" Then
' Category has been chosen, so let's save it in a cookie
iLastCategory = Request.QueryString("lstCategory")
Response.Cookies("LastCategory") = iLastCategory
Response.Cookies("LastCategory").Expires = Date() + 10
Else
' Page is requested directly, so get the cookie
If Len(Request.Cookies("LastCategory")) > 0 Then
iLastCategory = CInt(Request.Cookies("LastCategory"))
End If
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoDateTime(str, nNamedFormat, nLCID)
dim strRet
dim nOldLCID
strRet = str
If (nLCID > -1) Then
oldLCID = Session.LCID
End If
On Error Resume Next
If (nLCID > -1) Then
Session.LCID = nLCID
End If
If ((nLCID < 0) Or (Session.LCID = nLCID)) Then
strRet = FormatDateTime(str, nNamedFormat)
End If
If (nLCID > -1) Then
Session.LCID = oldLCID
End If
DoDateTime = strRet
End Function
</SCRIPT>
<html><!-- InstanceBegin template="/Templates/mainTemplate.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>GlobalSoccerEvents.com-Your Source for Soccer Events Around the Globe</title>
<!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<%
Dim sBackgroundColor
If Len(Request.Cookies("BackgroundColor")) > 0 Then
sBackgroundColor = Request.Cookies("BackgroundColor")
Else
sBackgroundColor = "#ffffff" ' Our default background color
End If
Dim iTheme
If Len(Request.Cookies("SiteTheme")) > 0 Then
iTheme = Request.Cookies("SiteTheme")
Else
iTheme = 1 ' Our default theme
End If
Dim sBadge
If Len(Request.Cookies("SelectedBadge")) > 0 Then
sBadge = Request.Cookies("SelectedBadge")
Else
sBadge = "logo" ' Our default logo
End If
%>
<link href="Styles/mainStyles.css" rel="stylesheet" type="text/css">
<link href="Styles/mainStyles<%=iTheme%>.css" rel="stylesheet" type="text/css">
</head>
<body style="background-color: <%=sBackgroundColor%>"><!-- #BeginLibraryItem "/Library/mainMenu.lbi" --><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="Images/<%=sBadge%>.gif" name="imgDefaultBadge" id="imgDefaultBadge"></td>
<td>
<table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td><a href="home.asp" id="home">Home</a></td>
<td> </td>
<td><a href="events.asp" id="events">Events</a></td>
<td> </td>
<%
MM_authorizedUsers="Administrators,Members"
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
%>
<td><a href="mySite.asp" id="mysite">My Site</a></td>
<td> </td>
<%
End If
End If
%>
<%
MM_authorizedUsers="Administrators"
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
%>
<td><a href="Admin/admin.asp" id="admin">Admin</a></td>
<td> </td>
<%
End If
End If
%>
<td><a href="login.asp" id="login">Login</a></td>
</tr>
</table></td>
</tr>
</table>
<br>
<script language="JavaScript" type="text/javascript">
var sPageName = '<%=Request.ServerVariables("SCRIPT_NAME")%>';
sPageName = sPageName.substr(sPageName.lastIndexOf('/') + 1).toLowerCase();
sPageName = sPageName.substr(0, sPageName.lastIndexOf('.'));
if (document.getElementById(sPageName))
{
document.getElementById(sPageName).style.fontWeight = 'Bold';
document.getElementById(sPageName).style.fontSize = '14pt';
}
</script>
<!-- #EndLibraryItem -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><h2><!-- InstanceBeginEditable name="Title" -->Current Events<!-- InstanceEndEditable --></h2></td>
</tr>
<tr>
<td><!-- InstanceBeginEditable name="Content" -->
<form action="events.asp" method="get" name="frmSelectCategory">
<select name="lstCategory" onChange="document.frmSelectCategory.submit();">
<option value="">Select a Category</option>
<% If iLastCategory = 1 Then sSelected = " selected=""selected""" _
Else sSelected = ""%>
<option value="1"<%=sSelected%>>Champions League</option>
<% If iLastCategory = 2 Then sSelected = " selected=""selected""" _
Else sSelected = ""%>
<option value="2"<%=sSelected%>>UEFA Cup</option>
<% If iLastCategory = 3 Then sSelected = " selected=""selected""" _
Else sSelected = ""%>
<option value="3"<%=sSelected%>>National League</option>
<% If iLastCategory = 4 Then sSelected = " selected=""selected""" _
Else sSelected = ""%>
<option value="4"<%=sSelected%>>US Major League Soccer</option>
</select>
<table width="600" border="1" cellspacing="2" cellpadding="2">
<tr>
<td class="clsHeading"><%=(rsEvents.Fields.Item("Title").Value)%></td>
</tr>
<tr>
<td class="clsSummary"><%=(rsEvents.Fields.Item("Summary").Value)%></td>
</tr>
<tr>
<td>This event will last from <%= DoDateTime((rsEvents.Fields.Item("StartDate").Value), 1, 1033) %> until <%=(rsEvents.Fields.Item("EndDate").Value)%></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</form>
<!-- InstanceEndEditable --></td>
</tr>
<tr>
<td align="center">
<br>
<br>
<br>
<br>
<br>
<!-- InstanceBeginEditable name="Footer" --><!-- InstanceEndEditable -->
</td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
<%
rsEvents.Close()
Set rsEvents = Nothing
%>
__________________
Tracey
|
|

December 1st, 2009, 06:01 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Tracey,
I see your point about the records in the older chapter's code. I'll see if I can fix that somehow, although I believe you're probably the only person in the world still reading this book ;-)
I don't know what to say about the other issues. The code is supposed to work, as I have followed it many many times. I know Dreamweaver MX 2004 has issues where it thinks something cannot be updated. Reapplying the behavior often fixes the issue. And did you install Serivce Packs for Dreamwever? Otherwise, manually typing in the necessary code in the Code Editor may fix it.
I can't test for myself as I don't have Dreamwevaer MX installed here anymore. As I indicated earlier, you're working with old, out-dated and obsolete technology. Both Dreamweaver MX 2004 as classic ASP are ancient, old, out-dated and have each been followed up by at least 5 new iterations. This makes it difficult to a) do something useful with it after you've mastered it and b) find a helping hand as I don't have the necessary software installed anymore....
There are still many existing sites that use classic ASP, so a job as a maintenance developer is still an option.... ;-)
Cheers,
Imar
|
|
 |