 |
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
|
|
|
|

November 24th, 2005, 06:57 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Sounds like you missed a MoveNext somewhere...
If that doesn't help, can you post your code?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

November 25th, 2005, 04:39 AM
|
|
Friend of Wrox
|
|
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thank you.i will post my code to your personal mail if it doesn't any matter for you.
|
|

November 25th, 2005, 04:49 AM
|
|
Friend of Wrox
|
|
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
this is my codes for a tr and sorry if i is very much.
other trs have the sam codes with different ifs
<tr>
<td> </td>
<td nowrap><strong>4083</strong></td>
<td nowrap class="unnamed1"> </td>
<td nowrap><strong>Intake
Silencer</strong></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="05" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="06" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="07" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="08" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="09" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="10" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="11" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="12" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="13" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="14" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="15" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="16" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="17" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="18" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="19" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="20" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="21" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="22" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="23" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="24" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="25" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="26" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="27" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="28" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="29" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="30" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="31" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="32" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="33" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="34" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="35" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="36" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="37" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="38" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="39" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="40" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="41" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="42" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="43" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="44" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="45" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="46" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="47" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="48" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="49" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
<td class="unnamed1"> </td>
<td><%rs.movefirst
while not rs.eof
if (rs("unitNo")="50" and rs("HGNo")="4083") then
Subheading
end if
rs.movenext()
wend%></td>
</tr>
thank you Imar for you attentions.
|
|

November 26th, 2005, 01:00 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
What kind of data do you have in your recordset that requires this million loops? Isn't it possible to order the recordset once when querying the database, and then looping through it only once, using something like a Select Case statement to determine the current record and act upon it?
Can you explain the business logic behind this page a little? There may be much simpler / more efficient ways to do it.
If you need to keep your current page structure, I suggest you look into the Filter property of the Recordset object. While filtering isn't very efficient itself and is much better done at the database level in your SELECT statement, I am sure it beats looping through the same recordset a billion times. Check out this MSDN article for more information: http://msdn.microsoft.com/library/de...dprofilter.asp
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

November 27th, 2005, 02:33 AM
|
|
Friend of Wrox
|
|
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I have some HGs that each HG has 50 units and this page is a main report about our project that tells each HG of each units situation.
I wrote this program with a while loop for a table but it showed each record in one table and there was many tables(the database is very huge with many columns that we get different types of reports from it.in addition i should write the HGs and units dynamically.HGs are placed in a column at the left of the page and units are placed in a row on top of the page.I thought this way my program will work but it takes too much time to load.(i changed the time out time to <% Server.ScriptTimeout = 660 %>and it is working now but takes about 5 minuts to load)
if there is a better structure please guide me.
thank you
|
|

November 27th, 2005, 05:47 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
quote:if there is a better structure please guide me.
|
Well, it all depends on your design. That's why I asked about business logic. I also depends on the amount of data in your database. Do you get all HGs (whatever they are) at once? And did you try it using the Filter property I showed earlier? That should speed things up....
What is an HG and how much units does it have? What's the *logic* about presenting the data on the page? How does your database look like? How are things related?
Without this information, it's hard to propose a better solution....
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

November 27th, 2005, 07:43 AM
|
|
Friend of Wrox
|
|
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
HGs are some materials that has different names and numbers.and each unit has some HGs in it.we have 50 units and about 60 HGs for each unit.there is a very huge data in the database(about 3000 records with 50 columns in SQL database)and this data is getting more and more.the program has a function that compare the situation of each HG and shows its situation in its special cell in the table and because of that i should write those ifs to verify the unit and HG.this program is written for project planning and we want to control each HG by this table.
|
|

November 28th, 2005, 03:02 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Since you didn't answer most of my other questions, I can only assume you're trying things out right now? Is the Filter property any good to you?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Weapon of Choice by Fatboy Slim (Track 8 from the album: Halfway Between the Gutter and Stars) What's This?
|
|

November 29th, 2005, 12:56 AM
|
|
Friend of Wrox
|
|
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I used filter property(where filter)and didnt write select *( i wrote just the coulmns that was needed in my program).but yet it is a very huge data in recordset that should be checked.can i use ado for checking data instead of recordset?and if i can use it how?if not how can i reduce this time of load?i couldn't use more filters because it wouldn't show all Hgs that i wanted to have.
please help me to solve it
|
|

November 29th, 2005, 03:24 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Check my previous replies; I asked a bunch of questions that you need to answer before I can help you:
How is the database designed? What tables does it have and how are they related? How many HG records do your query? How many records are there in your recordset when you start looping. How does your select statement look like? Do you use a proper WHERE clause to filter records at the database level?
What kind of data do you have in your recordset that requires this million loops? Isn't it possible to order the recordset once when querying the database, and then looping through it only once, using something like a Select Case statement to determine the current record and act upon it?
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).
I believe I asked even more questions, but I didn't look them up all.
The suggestion about pseudo code is really important. Try to visualize what you want the app to do. Taking one step back and stop trying to fix your problem through code often helps. It may be a design issue instead of a code issue.
Then explain us what it does and we might ne able to help. Right now, all I now is that a HG has units and that you loop an awful lot.
Not really enough information to make a balanced decision.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|
 |