[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Microsoft OLE DB Provider for SQL Server error '80040e31' Timeout expired .

Posted on 2006-07-21
12
Medium Priority
?
5,775 Views
Last Modified: 2011-10-03
Hello All,

I am developed a stored procedure in SQL Server which takes the CSV file coverts its rows into sql Rows. I Have an ASP page where I upload the CSV file and click on the Add button. This takes the file name and excutes the stored procedure. This works fine. A table (main table) in the backend gets created with all the SQL rows. This table has additional columns which gets the data from other tables like region (the value comes from region table). I have developed an ASP page which does the job of updating the main table with the values from transaction tables. Therefore this ASP page has many loops and has to process more than 5000 records at a time. When it starts processing more then 1000 records , it gives me an error. Microsoft OLE DB Provider for SQL Server error '80040e31' Timeout expired . Please help me in resolving this issue.This is quite urgent.


0
Comment
Question by:tanveer_1476
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
12 Comments
 
LVL 23

Expert Comment

by:apresto
ID: 17154261
Hi tanveer_1476,

You will need to extend the TimeOut property of your command object - how are you executing the stored procedure in the asp?

Apresto
0
 
LVL 23

Expert Comment

by:apresto
ID: 17154282
try this:

System.Diagnostics.FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location)
0
 
LVL 23

Expert Comment

by:apresto
ID: 17154285
Sorry, wrong question, ignore that last comment
0
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 

Author Comment

by:tanveer_1476
ID: 17154413
Hello,

I am executing the stored procedure this way. When I include the objConn.timeout = 200 . it gives me an error. To me it doesn't look like a stored procedure error. As the page has many loops , problem is coming up.

sSql = "sp_main_backup_mt 'main_backup_mt', '"&strev&"'"
objConn.Execute(sSql)
objConn.timeout = 200
0
 
LVL 23

Expert Comment

by:apresto
ID: 17154434
ok, you'll need to use the command object of ASP to be able to specify a time out, the syntax is as follows:...
0
 
LVL 23

Expert Comment

by:apresto
ID: 17154446
dim cmd
set cmd = Server.CreateObject("ADODB.command")
cmd.ActiveConnection = objConn
cmd.CommandText = "sp_main_backup_mt 'main_backup_mt', '"&strev&"'"
cmd.CommandType = 04
CommandTimeout = 60 'Seconds
0
 
LVL 23

Expert Comment

by:apresto
ID: 17154465
you may need to include a file at the top of your asp page : the ADOVBS file

here is some info on it:

http://www.4guysfromrolla.com/webtech/faq/Beginner/faq7.shtml

you can also get it from the location above.  Its so that you can specify the commandType using 04 rather than the equivelant of &H0004

i.e

cmd.CommandType = &H0004
0
 
LVL 23

Expert Comment

by:apresto
ID: 17154476
you can extend the timeout by changing the CommandTimeout property (in seconds)

CommandTimeout = 60
0
 
LVL 12

Accepted Solution

by:
AshleyBryant earned 1500 total points
ID: 17154507
If all of this information is in your SQL database, then why aren't you having the SQL server do all the work that your ASP is doing?  It would save you a lot of processing time and looping within ASP.
0
 

Author Comment

by:tanveer_1476
ID: 17154542
when i include the above code , it just come out without doing anything (:-
0
 

Author Comment

by:tanveer_1476
ID: 17154622
Hi Ash,
How do I go about this . For example I have one loop


sqlMain = "Select currency,exp_date from main_backup_mt"
set rsmain1 = objConn.execute(sqlMain)
set rsConv =  Server.CreateObject("ADODB.Recordset")
set rsConv =   objConn.execute(sqlConversion)
do while not rsmain1.eof
do while not rsConv.eof

                dcdate =datepart("d",(rsConv.fields("start_date")))
                  mcdate = datepart("m",(rsConv.fields("start_date")))
                  ycdate = datepart("yyyy",(rsConv.fields("start_date")))
                  scDate= mcdate & "/" &dcdate & "/" & ycdate
                  
                  edcdate = datepart("d",(rsConv.fields("end_date")))
                  emcdate = datepart("m",(rsConv.fields("end_date")))
                  eycdate = datepart("yyyy",(rsConv.fields("end_date")))
                  ecDate= emcdate & "/" &edcdate & "/" & eycdate
                  

      sqlConvupdate = "update main_backup_mt set exchange_rate = '"&rsConv.fields("conversion_rate")&"' where currency = substring('"&rsConv.fields("currency")&"',1,3) and exp_date between '"&scDate&"' and '"&ecDate&"'"
      
      Set rsUpdate = Server.CreateObject("ADODB.Recordset")
      set rsUpdate = objconn.execute(sqlConvupdate)
rsConv.movenext
response.Flush()
loop
'response.Write(rsmain1.fields("currency")) &" from main" & "<br>"
rsmain1.movenext
response.Flush()
loop
0
 

Author Comment

by:tanveer_1476
ID: 17184690
Please close this call as I have resolved the error.
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question