473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

More efficient script

I am trying to pull up all orders on one page so that it can be printed off in one push of a button. Once it gets to around 250-270 orders the script times out. Here is a map of what it is doing

SQL STATEMENT MAKES A SET OF ORDER NUMBERS THAT NEED TO BE LOADED

DO WHILE LOOP RUNS TILL EOF

SQL STATEMENT BRINGS IN DATA FOR PRESENT ORDER

HTML/VBSCRIPT WRITES OUT ORDER

MOVENEXT
END LOOP

PRINT BUTTON

How can I make it more efficient so I can ensure that all orders load.

That is the first question.

An answer to this question would be helpful too. What do you think would be the best way to mark them in the database. When the orders are printed the page needs to put some information into the database:

Binary that it was printed
DateTime for the date and time it was printed
And estimated weight of order

This is presently done with a form which posts the info to a second vbscript page but the orders only print one at a time.

I was thinking I could use arrays for each item and step through them in the printing function. But would I want to redim the array each loop through or would I want to run a count query on the data before making the dataset to know what size to make the array?

Lastly I need backup info when not if the printer has an issue; runs out of ink have way through and half prints 100 pages. So I would want to make a log of order numbers for each print. Do this with an array? Or append the info on to a string and break it up later?

Any ideas would be well appreciated. Thanks, Ben.
Sep 7 '07 #1
5 1245
jhardman
3,406 Expert 2GB
Ben,

This is a very straight-forward script, I don't see an easier or more efficient way to do it. This shouldn't take super long, I have some pages that pull up close to a thousand records before timing out. Anyway, the default time limit is 90 seconds or so, you might want to set the timeout at 5 minutes:
Expand|Select|Wrap|Line Numbers
  1. <% Server.ScriptTimeout = 300 %>
Let me know if this helps.

Jared
Sep 10 '07 #2
iam_clint
1,208 Expert 1GB
make your remembering to do rs.movenext
Sep 10 '07 #3
jhardman
3,406 Expert 2GB
make your remembering to do rs.movenext
That's right, now that I think about it. Most of the time I get time outs, they are caused by failure to advance through a loop correctly. For example, even if your movenext is there, some errors with an appropriate error handler will break loops and make them go forever. Are you using an error handler?

Jared
Sep 10 '07 #4
No error Handling in there as of yet. I feel that it will work just fine with the larger timeout. I will let you know when I find out. I am now having a hard time with the post. I need to mark all the orders that are printed as printed in the db. As each order pulls up the order id number gets amended to the end of a comma separated string. This I need to post to a new page. But when I post I get a http 500. I have never seen a post have a problem posting to another page unless that page just simply doesn't exist. What general causes posts to return a 500? Thanks for your help, Ben.
Sep 12 '07 #5
jhardman
3,406 Expert 2GB
No error Handling in there as of yet. I feel that it will work just fine with the larger timeout. I will let you know when I find out. I am now having a hard time with the post. I need to mark all the orders that are printed as printed in the db. As each order pulls up the order id number gets amended to the end of a comma separated string. This I need to post to a new page. But when I post I get a http 500. I have never seen a post have a problem posting to another page unless that page just simply doesn't exist. What general causes posts to return a 500? Thanks for your help, Ben.
When you are using a querystring it could be that a period or some other special character is messing up the URL syntax.

Jared
Sep 13 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: LRW | last post by:
I'm working on some scripts someone else made, and it's littered with repetitive mysql_connect's and mysql_select_db's. For example: // MAKE SURE IT IS A VALID PRODUCT $connection2 =...
21
by: Rabbit63 | last post by:
Hi: I want to show a set of records in the database table on the clicnt browser. I have two ways to do this (writen in JScript): 1.The first way is: <% var sql = "select firstname from...
10
by: Amit | last post by:
Which is more efficient and why? p++ or ++p. Thanks.
3
by: Brian Wotherspoon | last post by:
I have a table with data that is refreshed regularly but I still need to store the old data. I have created a seperate table with a foreign key to the table and the date on which it was replaced. ...
20
by: laredotornado | last post by:
Hi, I'm using PHP 4.3. I have 15 pages in which I need to take the content of the BODY and put it in a little table ... <table> <tr><td colspan="3"><img src="header.gif"></td></tr> <tr>...
35
by: Bjoern Hoehrmann | last post by:
Hi, For a free software project, I had to write a routine that, given a Unicode scalar value U+0000 - U+10FFFF, returns an integer that holds the UTF-8 encoded form of it, for example, U+00F6...
7
by: Elizabeth Barnwell | last post by:
This may be a useful tool to better understand & find Javascript concepts: http://www.yoyobrain.com/subjects/show/240 Add flashcards to your studies, click on cram with the learning wizard. ...
3
by: Ken Fine | last post by:
This is a question that someone familiar with ASP.NET and ADO.NET DataSets and DataTables should be able to answer fairly easily. The basic question is how I can efficiently match data from one...
1
by: joshai | last post by:
Hi, I'm pretty new to the php/mysql world and am building an article database for a website with multiple content types. I have an entry screen built that allows the site owner to enter articles,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.