Wrox Programmer Forums
|
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
 
Old May 22nd, 2008, 05:02 AM
Registered User
 
Join Date: May 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default difficulties with BuildingBlock

 hope someone can help me - I am complete newbie to this forum

I have a question on buildingblock. I am working on a new website based upon Buildingblock technology and am using the february 2003 edition of the book.

when I attempt to preveiw the building block, I get an error initially on line 61.

The code on line 61 looks like this.......

    <td width="10" height="190" rowspan="3"><img src="<%=(section.Item("").Value%>" width="<%=(section.Item("Left_Width").Value)%>" height="<%=(section.Item("Left_Height").Value)%>" name="" alt="">

so, as instructed in the book I have inserted '.Fields' into the code at the relevant place so the code now looks like this.....

    <td width="10" height="190" rowspan="3"><img src="<%=(section.Fields.Item("").Value%>" width="<%=(section.Fields.Item("Left_Width").Value )%>" height="<%=(section.Fields.Item("Left_Height").Val ue)%>" name="" alt="">

now I have a '!' alongside all of the dynamicimage in server behaviors, when I click on the top one I get the follow error....

'section.Fields recordset not found please select another recordset.'

Has anyone any idea what I am doing wrong.

apologies if this is too basic for this forum.


 
Old May 22nd, 2008, 12:45 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

It's been a while since I worked on this book. And, even worse, I didn't write that section of the book.

You only mention line 61, but not a page name or a page number of the book, so I couldn't look it up. However, this doesn't look right:

<img src="<%=(section.Fields.Item("").Value%>"

There is a closing ) missing in there:

<img src="<%=(section.Fields.Item("").Value)%>"

Although you may not even need it at all:

<img src="<%=section.Fields.Item("").Value%>"

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old May 23rd, 2008, 10:13 AM
Registered User
 
Join Date: May 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar,

I am officially an idiot. I have now checked the entire document and believe it to be correct, I am no longer getting the code error !

However, I am now getting the following response when I preview Buildingblock.asp.....

The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

--------------------------------------------------------------------------------

Please try the following:

Click the Refresh button, or try again later.

Open the localhost home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Microsoft JScript runtime (0x800A01B6)
Object doesn't support this property or method
/moneymiser.org.uk/TMP1hixc1bt6d.asp, line 56


Browser Type:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)

Page:
GET /moneymiser.org.uk/TMP1hixc1bt6d.asp

Time:
23 May 2008, 15:49:26


More information:
Microsoft Support


The code for the full buildingblock.asp follows....

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>

<%
var Section__MMColParam = "1";
if (String(Request.QueryString("SectionID")) != "undefined" &&
    String(Request.QueryString("SectionID")) != "") {
  Section__MMColParam = String(Request.QueryString("SectionID"));
}
%>
<%
var Section = Server.CreateObject("ADODB.Recordset");
Section.ActiveConnection = MM_moneymiseruk_STRING;
Section.Source = "SELECT * FROM Sections WHERE ID = "+ Section__MMColParam.replace(/'/g, "''") + "";
Section.CursorType = 0;
Section.CursorLocation = 2;
Section.LockType = 1;
Section.Open();
var Section_numRows = 0;
%>
<html>
<head>
<title><%=(Section.Fields.Item("Section_Name").Val ue)%></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="/development/blockstyles.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body bgcolor="#CCCCCC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages(<%=(Section.Fields.Item(" top_rollover").value)%>'')">
<table width="190" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="10" height="190" rowspan="3"><img name="" src="<%=(Section.Item("Left_Graphic").Value)%>" width="<%=(Section.Item("Left_Width").Value)%>" height="<%=(Section.Item("Left_Height").Value)%>" alt=""></td>
    <td width="170" height="10"><a href="<%=(section.Fields.Item("Link").Value)%>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Title','',<%=(Section.F ields.Item("top_rollover").value)%>'',1)"><img src="<%=(Section.Item("Top_Graphic").Value)%>" name="Title" width="<%=(Section.Item("Top_Width").Value)%>" height="<%=(Section.Item("Top_Height").Value)%>" border="0"></a></td>
  <td width="10" height="190" rowspan="3"><img name="" src="<%=(Section.Item("Right_Graphic").Value)%>" width="<%=(Section.Item("Right_Width").Value)%>" height="<%=(Section.Item("Right_Height").Value)%>" alt=""> </td> </tr>
  <tr>
    <td height="170"> </td>
  </tr>
  <tr>
    <td width="170" height="10"><img name="" src="<%=(Section.Item("Bottom_Graphic").Value)%>" width="<%=(Section.Item("Bottom_Width").Value)%>" height="<%=(Section.Item("Bottom_Height").Value)%> " alt=""></td>
  </tr>
</table>
</body>
</html>
<%
Section.Close();
%>

Line 56 is emboldened

For reference I am currently at page 602 in Chapter 16 of Beginning Dreamweaver MX.

I am currently looking at the error code on various forums to see if I can bottom this out but if you have any ideas I would be grateful.

best regards

 
Old May 23rd, 2008, 11:38 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Are you sure that is the right line? I can't see anything wrong with it.... What happens when you temporarily delete the line from the source?

Take a look here: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=264

That may give you more information about the cause of the error.

If this is a new site, are you sure you want to continue with Classic ASP? If you have the time and interest, you could also take a look at ASP.NET....

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old May 23rd, 2008, 02:15 PM
Registered User
 
Join Date: May 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi again,

For clarity, I am developing in asp because that is what is used in the book. What advantages would I have by moving to asp.net ?

also I have copied line 56 from the original document and if follows:

  <td width="10" height="190" rowspan="3"><img name="" src="<%=(Section.Item("Left_Graphic").Value)%>" width="<%=(Section.Item("Left_Width").Value)%>" height="<%=(Section.Item("Left_Height").Value)%>" alt=""></td>

It is safe to assume that the line number in the temp file generated by the preveiw exactly matches the line number in the original document ?

By the way, up till now I have thoroughly enjoyed the book (and am still enjoying it)

best regards

 
Old May 23rd, 2008, 06:08 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

I didn't ask to paste the line here as I could clearly see it in the first example you posted; I suggested to remove it from the code instead so you can if the error goes away.

As you said in your first post, the book is from 2003; 5 years ago or ages in the Internet era ;) The technology used is even older. In November 2007 Microsoft has released ASP.NET 3.5, the fourth(!!) and latest version of the successor to "classic ASP". ASP.NET is in many (if not all) a lot better alternative to classic ASP. Better tool,s better run-time options, better performance, better integration with modern techniques like data access, LINQ, AJax and a whole lot more. I can't list all benefits in a single post but I'll be happy to show you more if you're interested.

Did the article I posted help you get a better error message? It's not always safe to assume the line number is correct. That's why I suggested to remove the offending line to confirm that...

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
While typing this post, I was listening to: Blackout by Muse (Track 9 from the album: Absolution) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
BuildingBlock Problem sandyh BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 4 May 22nd, 2008 05:04 AM
SELECT Query Difficulties mccoy Access 2 June 17th, 2007 06:02 PM
Access2003 Difficulties marclf Access VBA 0 October 31st, 2006 09:04 AM
Insert on server difficulties! fskilnik Dreamweaver (all versions) 4 August 22nd, 2005 10:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.