Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) 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 January 14th, 2005, 01:22 PM
Authorized User
 
Join Date: Aug 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default buildng blocks

Hi Imar,

My prob is that when selecting "live data view" the image,(fig 15-27) does not appear. I get a message saying that line 65 is incorrect, but I can't see where. Also I noted that the server behavior list were showing red exclamation marks indicating a fault.
When I click on one, a message states that no recordset was found. If I double click I get tbe Dynamicimage menu (fig 15-25). If I retype in the missing items, (some are there, some are greyed out) I get rid of the red warning but still cannot generate the image fig 15-27 One further point, lines 5/6/7 the letters "ID" do not appear when the code block is loaded (page 556). I have to type in "ID" on each line.

I hope this clarifies my prob.

Changing the subject, I have now completed my first web site, It's not great , but it does all work, thanks to Beginning Dreamweaver 2004. The address is cdsservices.co.uk.

Regards and looking forward to your reply

Terry s

 
Old January 15th, 2005, 05:46 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Terry,

If you post to this forum can you please

a) add a reply to a previous message (if related) rather than opening a new post? This makes it much easier to see what's going on, so I don't have to switch between many browser windows with partial messages and

b) post the relevant code for the section you're working on? I haven't actually memorized the book, so seeing some code definitely helps me (and others on this forum) in diagnosing the error and

c) Be specific about the error you get? "line 65 is incorrect" isn't really helpful in seeing what's going on.

If you see red exclamation marks in the Server Behavior panel, this usually indicates that something broke on your page. Maybe you manually changed the code for a SB (even a single line break in the code can mess things up) or maybe you removed parts of the SB.

Probably the best thing to do is start all over with the page; that way, you can recreate the page step by step and see where it's breaking....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Sing For The Moment by Eminem (Track 12 from the album: The Eminem Show) What's This?
 
Old January 17th, 2005, 01:53 PM
Authorized User
 
Join Date: Aug 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

I have taken your advice and rebuilt the complete site, but still have the same prob. I cannot generate the image as per chapter 15 page 562 fig 15-27.
I note that when I change the code (page 561) the place holders appear in a horizontal line in design mode.
When I add the code "Fields." as per page 562 this is when I get the red exclamation marks in the server behaviour panel.
I have now rebuilt the site six times and but each time when I get to page 562 I'm stuck.
I also note that page 563 fig 15-28, shows the second item in the list of behaviours "Dynamic Text (Section.Section_Name).This item does not appear in my list. and I don't recall any mention of it up to this point in the book.
Please advise, before I lose my mind.

Terry s



 
Old January 17th, 2005, 03:37 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Can you please post the code for the page you're having problems with?

Like I said in my previous message, it's hard for me to see what's going if you don't post your code. Unfortunately, I do not have the time to recreate the entire page by following all the steps in the book, only to find out I can't reproduce your error.

Post the code, and I'll take another look.

Also, like I asked earlier, what error do you get in the Live Data View? Without explicit error information, I cannot say anything useful about your problem.....

Cheers,

Imar

P.S. Don't give up. We'll work this out, I am sure.....

---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 18th, 2005, 01:17 PM
Authorized User
 
Join Date: Aug 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

I have included the code as requested
Code:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>

<%
var Section__MMColParam = "1";
if (String(Request.QueryString("section")) != "undefined" && 
    String(Request.QueryString("section")) != "") { 
  Section__MMColParam = String(Request.QueryString("section"));
}
%>
<%
var Section = Server.CreateObject("ADODB.Recordset");
Section.ActiveConnection = MM_MediaEdge_STRING;
Section.Source = "SELECT * FROM Content WHERE ID = "+ Section__MMColParam.replace(/'/g, "''") + "";
Section.CursorType = 0;
Section.CursorLocation = 2;
Section.LockType = 1;
Section.Open();
var Section_numRows = 0;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
    background-color: #FFFFFF;
}
-->
</style>
<link href="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 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.Fields.Item("Left_Graphic").Value) %><%=(Section.Fields.Item("Left_Width").Value) %><%=(Section.Fields.Item("Left_Height").Value)%>" width="32" height="32" alt=""></td>
    <td><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Title','','<%=(Section.Fields.Item("Top_Rollover").Value)%>',1)"><img name="Title" border="0" src="<%=(Section.Fields.Item("Top_Graphic").Value) %><%=(Section.Fields.Item("Top_Width").Value) %><%=(Section.Fields.Item("Top_Height").Value)%>"></a></td>
    <td width="10" height="190" rowspan="3"><img name="" src="<%=(Section.Fields.Item("Right_Graphic").Value) %><%=(Section.Fields.Item("Right_Width").Value) %><%=(Section.Fields.Item("Right_Height").Value)%>" width="32" height="32" alt=""></td>
  </tr>
  <tr>
    <td height="170"> </td>
  </tr>
  <tr>
    <td><img name="" src="<%=(Section.Fields.Item("Bottom_Graphic").Value) %><%=(Section.Fields.Item("Bottom_Width").Value) %><%=(Section.Fields.Item("Bottom_Height").Value)%>" width="32" height="32" alt=""></td>
  </tr>
</table>
</body>
</html>
<%
Section.Close();
%>
My problems are many.
Whenever I add all the code "Fields" (page 562)left out by Dreamweaver, the red exclamation marks appear in the behaviors panel
On page 563 fig 15-28.

The item "Dynamic Text(Section....." does not appear in in my behavior panel.

When I test with Live Data View I get an error, line 64.

Lines 4,5 and 6 (var section) on my code does not include the letters "ID" after the word "Section" on each of the lines as shown in the book, page 556.

i have followed the book very carefully, but still cannot understand what goes wrong. Hope you can help

terry s





 
Old January 19th, 2005, 03:23 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 Terry,

Sorry for the late response. Needed to download the sample code and database from the Wrox site before I could take a look.

Did you compare your code with the code from the downloads that goes with the book? There are differences between what you have, and the original code.

First, look at the <body> tag:

<body onLoad="MM_preloadImages'<%=(Section.Fields.Item(" Top_Rollover").Value)%>'

The onload attribute is not closed properly:

... ("Top_Rollover").Value)%>'">

Next, your SQL statement mentions SELECT * FROM Content. Shouldn't that be SELECT * FROM Sections? I could be wrong, as I haven't checked all the steps in the book, and you didn't say what page you're working with (You know how hard it is to help somehow over a forum when you only have halve the information available???)

Maybe it helps: on the original page from the code download I also get red exclamation marks. However, when I view the page in the browser, it runs as expected. Did you already try that?

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Endlessly by Muse (Track 12 from the album: Absolution) What's This?
 
Old January 21st, 2005, 01:34 PM
Authorized User
 
Join Date: Aug 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar
Thanks for your reply. I have corrected everything you sugested but with the same fault. Error line 23.
I cannot get the image (fig 15-27) when I select Live Data View.
I have also tried with the red exclamations marks on show but with same result. I also tried in my web browser but with same result. It comes up with "error line 23" which is the title page line, the one you said the code was incomplete.
I have downloaded the code for buildingBlock.asp, however that doesn't work either
I did compare my code with the download, it is in part different as I have not yet completed the chapter. But I repeat, the download does not work either. I noted that on the download,that the building block image, in design mode is a totally different shape to mine. Mine is nearly square, the download is smaller and very oblong on a horizontal plane.
I don't understand your comment re. me not quoting the page no. I'm working on. I have been very careful to include all page no.s when ever I ask you for assistance. (check my previous mail).
So let me state that I am refering to the image on page 562, chapter 15 Beginning Dreamweaver 2004. This is the one I'm having trouble with.
I have included the code
Code:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>

<%
var Section__MMColParam = "1";
if (String(Request.QueryString("section")) != "undefined" && 
    String(Request.QueryString("section")) != "") { 
  Section__MMColParam = String(Request.QueryString("section"));
}
%>
<%
var Section = Server.CreateObject("ADODB.Recordset");
Section.ActiveConnection = MM_MediaEdge_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;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><%=(Section.Fields.Item("Section_Name").Value)%></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="blockStyles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
    font-family: Arial, Helvetica, sans-serif;
}
body {
    background-color: #FFFFFF;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
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_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_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 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 src="<%=(Section.Fields.Item("Left_Graphic").Value) %>" name="" width="32" height="32" alt=""></td>
    <td><a href="<%=(Section.Fields.Item("Link").Value)%>"target="navigation" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage'<%=Section.Fields.Item("Roll_Over").Value%>','','',1)"><img src="<%=(Section.Fields.Item("Top-Graphic").Value) %>" name="Section" border="0"></a></td>
    <td width="10" height="190" rowspan="3"><img src="<%=(Section.Fields.Item("RIght_Graphic").Value) %>" name="" width="32" height="32" alt=""></td>
    <%=(Section.Fields.Item("Left_Width").Value) %><%=(Section.Fields.Item("Bottom_Width").Value) %><%=(Section.Fields.Item("Bottom_Height").Value) %>
    <%=(Section.Fields.Item("Top_Width").Value) %><%=(Section.Fields.Item("Top_Height").Value) %><%=(Section.Fields.Item("Graphic_Height").Value) %><%=(Section.Fields.Item("Right_Width").Value) %><%=(Section.Fields.Item("Right_Height").Value) %>

  </tr>
  <tr>
    <td height="170"> </td>
  </tr>
  <tr>
    <td><img src="<%=(Section.Fields.Item("Bottom_Graphic").Value)%>" name="" width="32" height="32" alt=""></td>
  </tr>
</table>
</body>
</html>
<%
Section.Close();
%>
of the page in question.
Be patient with me, I'm trying very hard to understand where the fault lies.

Regards

Terry s



 
Old January 21st, 2005, 04:06 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 Terry,

Sorry for the confusion. I wasn't referring to a page in the book (which you indeed stated very clear) but referring to the actual .asp page, like buildingBlock.asp

I asked this before but can you *pretty please, with sugar on top*, state the error message? There is not even a point for me trying to diagnose the problem or look at your code, without an explicit error message.
It's like going to a garage and say "Hi my car broke down, can you fix it", without telling them whether you're missing a tire, you can't start the engine, or your brakes don't work.

I haven't written the section about MediaEdge, so just like you I have to go over the code, and compare things with the book. An error message like "error line 23" just isn't enough for me to fix your problem.

I am trying to help you as much as you can, but if you don't help me helping you, then this isn't going to work. I don't want to be rude, and I do want to help you, but up until now, there isn't much I can do.

So, open the page you downloaded in Dreamweaver, press F12 to open it in the browser, and then tell me what error message you get. If the page is supposed to be in a frameset, and gets parameters through the QueryString (from the code you posted it looks like this page expects a query string), then make sure you open the frameset rather than this single page.

Cheers,

Imar
 
Old January 22nd, 2005, 12:29 PM
Authorized User
 
Join Date: Aug 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Got your message loud and clear!! I thought that referring to chapter 15 would be good enough.
However, lets start again from scratch.

I am referring to buildingBlocks.asp, chapter 15, page 562. It states at the top of the page 562, to check that the correct dynamic content will appear by checking in Live Data View, and if all is okay I should get results that look like fig 15-27. (page 562)
When testing this I get error messages.
I have tried also in my web browser
I have tested my own page and the downloaded page BB.asp. In both cases I get the same error message. The message is as follows.

"Error type
ADODB Fields (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/mediaedge/buildingBlocks.asp line 23"

I hope with all my heart this helps you help me.

Regards

Terry s

















 
Old January 22nd, 2005, 04:13 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Right. That makes things a lot clearer.

Usually, you get this error when you try to reference a column name that doesn't exist in your SQL statement, or doesn't exist in the database table.

Since you are selecting *, it cannot be your Sql statement, so it has to be the database.

Are you sure that the database for the connection string you're using (MM_MediaEdge_STRING) has a table called Sections with a column called Section_Name? It sounds like your database does to match the ASP pages. try replacing your database with the one from the code download.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Spacing between DIV blocks Cyber Shiva HTML Code Clinic 2 February 28th, 2007 03:31 PM
Building Blocks terry s Dreamweaver (all versions) 1 August 16th, 2005 02:42 PM
The 7 application blocks EricJ General .NET 0 June 30th, 2005 06:57 AM
Building Blocks terry s Dreamweaver (all versions) 1 January 12th, 2005 02:03 PM





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