473,626 Members | 3,322 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

More efficient script

23 New Member
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 1254
jhardman
3,406 Recognized Expert Specialist
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 Recognized Expert Top Contributor
make your remembering to do rs.movenext
Sep 10 '07 #3
jhardman
3,406 Recognized Expert Specialist
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
ryushinyama
23 New Member
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 Recognized Expert Specialist
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
1851
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 = mysql_connect("localhost", "root") or die ("Couldn't connect to the server."); $db2 = mysql_select_db("priceretail", $connection2) or die ("Couldn't select database."); $sql2 = "SELECT dbname FROM productlist WHERE ((accountid = 'printingautomation') OR...
21
3909
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 table1"; var obj=new ActiveXObject("ADODB.Recordset");
10
3499
by: Amit | last post by:
Which is more efficient and why? p++ or ++p. Thanks.
3
6418
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. I'm looking for an efficient way to select only the active data. Currently I use: SELECT ... FROM DataTable AS D LEFT OUTER JOIN InactiveTable AS I ON I.Key = D.Key
20
1749
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> <td><img src="left_img.gif"></td> <td><!-- body content goes here --></td> <td><img src="right_img.gif"></td> </tr>
35
4325
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 becomes 0x0000C3B6. I came up with the following. I am looking for a more elegant solution, that is, roughly, faster, shorter, more readable, ... while producing the same ouput for the cited range. unsigned int
7
1174
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. We're building this site to improve learning, so feedback on improvements and how to get this into the hands of developers is much appreciated. Feel free to email me too- elizabeth@yoyobrain.com...
3
2834
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 dataset to data in a second dataset, using a common key. I will first describe the problem in words and then I will show my code, which has most of the solution done already. I have built an ASP.NET that queries an Index Server and returns a...
1
2476
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, set article types, and set articles as features. Each page in the site calls the database for a feature article for that pages content type, then calls again for the 5 newest articles of that content type excluding any article that is identified as a...
0
8265
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8705
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8504
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4197
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1808
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.