473,386 Members | 1,602 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,386 software developers and data experts.

Timeout expired error while using select

Dax
Hi,
I have a problema of query in an asp page, if I run the query in sql
query analizer is time running it's about 3-4 seconds, if I made the
same query in an asp page it create the error of timeout for the
browser. The result of the query output 2000 of records, all in one
page.

The query is the following:

Legend:
A table ordini_user refer to user
U table utenti refer ti prodoct requested
q table refer to product available
select distinct p.cognome, a.ord_ID, q.prod_id, q.descrip, u.qta
from ordini_user A
join ordini_utenti U on A.ord_id = U.ord_id and u.ord_id like
'62006___'
join utenti p on A.id_user = p.codcliente
and p.cognome like '%Marco%'
join prodotto q on U.prod_id=q.prod_id
order by p.cognome, q.prod_ID

the asp code is the following

Set conn1 = Server.CreateObject("ADODB.Connection")
conn1.open "PROVIDER=SQLOLEDB;DATA
SOURCE=test_sql;UID=test;PWD=blank;DATABASE=Test"
set rs1=Server.CreateObject("ADODB.Recordset")

sql1="select distinct p.cognome, a.ord_ID, q.prod_id, q.descrip, u.qta
" &_
"from ordini_user A "&_
"join ordini_utenti U on A.ord_id = U.ord_id "&_
"and a.ord_id like '"&cod_ordine&"%' "&_
"join utenti p on A.id_user = p.codcliente "&_
"and p.cognome like '%"&fname&"%' join prodotto q on
U.prod_id=q.prod_id "&_
"order by p.cognome, q.prod_ID"

response.write(sql1)

rs1.Open sql1, conn1

do while not rs1.EOF
strtable = strtable & "<tr>" &_
"<td><input type='hidden' name='Cod' value=" & rs1(0)
& "></td>" &_
"<td bgcolor='#D0F1FF'><div align='center'><font
color='#000000'>" & rs1(0) & "</font></div></td>" &_
"<td bgcolor='#D0F1FF'><div align='center'><font
color='#000000'>" & rs1(1) & "</font></div></td>" &_
"<td bgcolor='#D0F1FF'><div align='center'><font
color='#000000'>" & rs1(2) & "</font></div></td>" &_
"<td bgcolor='#D0F1FF'><div align='center'><font
color='#000000'>" & rs1(3) & "</font></div></td>" &_
"<td bgcolor='#D0F1FF'><div align='center'><font
color='#000000'>" & rs1(4) & "</font></div></td>" &_
"</font></tr>"

Ho can I optimize or modify the output source consider that I want to
print all these records?

Jul 20 '06 #1
1 2460
Dax wrote:
Hi,
I have a problema of query in an asp page, if I run the query in sql
query analizer is time running it's about 3-4 seconds, if I made the
same query in an asp page it create the error of timeout for the
What kind of timeout? Script timeout or ADO Command timeout?

It never hurts to copy and paste the entire error message you are receiving,
as well as showing us which line of code is being referred to in the error
message.

browser. The result of the query output 2000 of records, all in one
page.

The query is the following:

Legend:
A table ordini_user refer to user
U table utenti refer ti prodoct requested
q table refer to product available
<snip>
do while not rs1.EOF
<snip>

I don't see an rs1.MoveNext statement. Are you sure you haven't created an
infinite loop?

http://www.aspfaq.com/show.asp?id=2366
http://www.aspfaq.com/show.asp?id=2066
http://www.aspfaq.com/show.asp?id=2424
http://www.aspfaq.com/show.asp?id=2120
http://www.aspfaq.com/show.asp?id=2467

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: David Morgan | last post by:
Hello In my ASP page I am trying to ascertain whether a randomly generated ID starts with certain characters that are not allowed or has been used before. When the SQL statement for latter is...
0
by: Silvia | last post by:
I have a application web and when execute this for a long time generated this error: Server Error in '/RAIMServer' Application. -----------------------------------------------------------...
5
by: Jason | last post by:
Hi all I get the following error when executing a rather intense stored procedure from an ASPX page. I have tried: - Increasing timeouts on IIS 5.0 (all areas that even mention timeout) - use...
2
by: Chris Langston | last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server that is experiencing strange shutdown problems. We are using ASP.NET v1.1 and our application is written in VB.NET ...
4
by: Nevyn Twyll | last post by:
I've been working on an asp.net application and everything's been great. But suddenly, whether I'm tyring to use a database on my own machine, or on my server, I'm getting a timeout when trying to...
3
by: Nils Magnus Englund | last post by:
Hi, I've made a HttpModule which deals with user authentication. On the first request in a users session, it fetches data from a SQL Server using the following code: using (SqlConnection...
4
by: VB Programmer | last post by:
When I run my ASP.NET 2.0 web app on my dev machine it works perfect. When I precomile it to my web deployment project and then copy the debug files to my web server I get this problem when trying...
0
by: bonita | last post by:
If I add the code for user to download the file (e.g. if(File.Exists(FILE_NAME)){......}), the ASP.NET will give the following timeout error: Timeout expired. The timeout period elapsed prior to...
4
by: mabubakarpk | last post by:
Hello to all I am using an application which is in vb6.0 and database in MSSQL server 2k. I am using connection string through ADO. Some times I receive message...
1
by: Scorpion657 | last post by:
Hey I really need help. I have a Website coded using ASP.NET and VB and for some reason, i'm getting the following error when I try to upload or access a large file which is stored in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.