Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Dreamweaver (all versions)
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 2nd, 2005, 06:28 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default have a table with static and dynamic values togeth

hello all
how can we have a table with some rows that has some columns too.which for exmple column number 4,5,6,7,... of each row is dyanmic and other columns are static?
i wrote a program that has 16 rows and 25 columns.colulmn number1,2,3 of each row contains row number,HGNo,UnitNo
and are static values that i wrote them myself.but other columns are dynamic and my program should read the record that has those HGNo,UnitNo and show some values in those columns.
for example:
 <% While (NOT rs.EOF)%><table><tr>
<td>if (rs("HGNo")="4021" and rs("UnitNo")="5" then
do some thing
</td></tr></table>
<%rs.movenext()
wend%>

Reply With Quote
  #2 (permalink)  
Old November 5th, 2005, 09:58 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

I am not sure I understand what you want. Can't you just add the static columns to the repeating code?
Code:
<table>
<% While  (NOT rs.EOF)%>
<tr>
  <td>Static Column 1</td><td>Static Column 1</td>
  <td><%= rs("SomeColumn") %></td><td><%= rs("SomeOtherColumn") %></td>
</tr>
<%rs.movenext()
wend%>
</table>
This displays a row for each record in your recordset. The first two columns display static data while the other two display data from the recordset.

Note that I took the <table> tags outside the loop.

Does this help?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old November 6th, 2005, 07:08 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

thank you.i've done it

Reply With Quote
  #4 (permalink)  
Old November 22nd, 2005, 08:00 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

i thought that the program is run correctly but now i sea just it woroks for first column of the first row.i wrote a while loop for each td because each td has a different program:
<tr><td>static value</td>
<td><%while not rs.eof
if(statement)then
...
end if
rs.movenext()
wend%>
</td></tr>
is it correct?????if it is correct why it doesn't work for other columns.

Reply With Quote
  #5 (permalink)  
Old November 22nd, 2005, 03:58 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

I don't know if this is correct, as it depends on your business logic.

This code writes out a single <tr> and loops through the recordset writing out the value for each record in a single <td>. If that's what you're after, it works....

If you want to write a row for each record in the recordset, move the code that writes a <tr> and a <td> to inside the loop.

E.g.:
Code:
<%while not rs.eof %>
<tr><td>static value</td>
<td>
<%
if(statement)then
...
end if
rs.movenext() %>
</td></tr>
<%wend%>
This writes out a row for each record, with a static column, and a column with data from the recordset.

HtH,

Imar



---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #6 (permalink)  
Old November 23rd, 2005, 01:00 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

those if's are for each record for each td.so as you said the program is write but it doesn't work.i will work on it maby somewhere i made a mistake.

Reply With Quote
  #7 (permalink)  
Old November 23rd, 2005, 02:45 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Do you want to repeat *all* records in the recordset in each table row?

Then you need to reset the recordset using MoveFirst.

If I were you, I'd first determine what exactly it is you want. Draw it out on a piece of paper, or try to write pseudo code of how you'd like the application to work. If you do that, things will be much clearer to you (and us).

Imar

---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #8 (permalink)  
Old November 23rd, 2005, 03:46 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

i want to search all the recordset for each td to find a recordset with special specifications that i defined them with if codes.
you mean i should write rs.movefirst for each td before while loop for searching from the first record????sorry if i'm not writting my programs in a right way.and thank you because your very useful helps during this time because there no one eles to help me



Reply With Quote
  #9 (permalink)  
Old November 23rd, 2005, 04:18 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Yes, exactly.

Using While .... MoveNext will loop through the entire recordset. After the last record, the recordset will be EOF (End of File). After that, you can no longer read from the recordset, until you call MoveFirst that positions the cursor at the first record so you can start looping.

HtH,

Imar


Reply With Quote
  #10 (permalink)  
Old November 24th, 2005, 03:08 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

I did everything as you said and it works in my local computer but when i uploaded it to internet it shows 6 rows and in one the columns of the 6th row it shows this error:
Active Server Pages error 'ASP 0113'

Script timed out

/kitmaterialsel.asp

The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools
what should i do with such error????

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
loop through static list of values? mister_mister XSLT 6 January 4th, 2008 11:48 AM
help writing dynamic form data to dynamic table ublend Classic ASP Professional 1 June 1st, 2007 08:08 AM
Dynamic Checkboxes using dynamic Select Values bsheridan Classic ASP Databases 0 March 12th, 2006 10:17 AM
Dynamic table values not returned in Netscape jminteer Classic ASP Professional 1 December 16th, 2005 03:43 PM
static HTML table border problem Robin1 HTML Code Clinic 4 August 12th, 2004 04:58 AM



All times are GMT -4. The time now is 01:54 PM.


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