Solved

odbc timeout problem

Posted on 2003-11-07
13
581 Views
Last Modified: 2012-06-21
Using DMX to create page that connects to our corp AS400 via ADO ODBC connection... here is the string that DMX created;

<%
Dim AIROUTBSHIP
Dim AIROUTBSHIP_numRows

Set AIROUTBSHIP = Server.CreateObject("ADODB.Recordset")
AIROUTBSHIP.ActiveConnection = MM_LTL400TAF_ASP_STRING
AIROUTBSHIP.Source = "SELECT * FROM BLAH"
AIROUTBSHIP.CursorType = 0
AIROUTBSHIP.CursorLocation = 2
AIROUTBSHIP.LockType = 1
AIROUTBSHIP.Open()

AIROUTBSHIP_numRows = 0
%>


When I test the connection I get the following error;

"[IBM][CLIENT ACCESS EXPRESS ODBC DRIVER(32-BIT)][DB2/400 SQL]SQL0666 - Estimated query processing time 1290 exceeds limit 30."

Is there a setting in DMX to override this 30 default or can I change the string to override? If so, how? I have looked at the ODBC administrator and see no option for changing the timeout setting there. Thanks!
0
Comment
Question by:MilburnDrysdale
[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
  • 8
  • 4
13 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9701490
Please show me your code for where you create the connection. I don't think that you can set the timeout for the recordset object.

Fritz the Blank
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9701494
YOu should be able do something like this:

      MM_LTL400TAF_ASP_STRING.ConnectionTimeout = 40

Fritz the Blank
0
 

Assisted Solution

by:ScotterMonkey
ScotterMonkey earned 250 total points
ID: 9701542
The problem may be with your ASP timeout. In IIS you can go to properties for a site, click on the HOME DIRECTORY tab, click on CONFIGURATION button, APP OPTIONS tab, and change session timeout to be a higher number.
PLEASE NOTE: This may not be a good way to deal with this problem. Problem might be the cursor choices combined with recordset result size might be taking too long to pull your data. I usually use code like this to read most recordsets, as long as you don't have to go backwards (rs.movefirst) in your set:

'set up conn object
Set conn = Server.CreateObject("ADODB.Connection")
ConnectionString = "DSN=shaolin"
conn.Open ConnectionString

'set up querystring
s = "SELECT"
s = s & " ID"
s = s & ",s_name_contact"
s = s & ",s_name_company"
s = s & ",s_title"
s = s & ",d_created"
s = s & ",s_state"
s = s & ",s_zip"
s = s & ",m_description"
s = s & ",s_type"
s = s & ",c_discount"
s = s & ",n_discount"
s = s & ",d_created"
s = s & " FROM coupons"
s = s & " WHERE ("
s = s & " ID_user=" & session("ID_user")
s = s & ")"
s = s & " ORDER BY " & s_sort
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open s, conn, 0, 1 '0=forward only, 1=lock read only

I've found this method to be quite fast. I hear you can get even faster if you use a DSN-less connection. And of course faster still if you use SQL Server and then faster still if you use Stored Procedures with SQL Server.

Hope this helps some!
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9701596
That is a good point--the code that I provided above will increase the timeout on your connection object, but if the process takes longer than 15 minutes, you may need to increase the timeout for the page.

Rather than doing on IIS, I prefer to do it just on the page to conserve resources. You can do that with this:

<%session.timeout=40%>

FtB
0
 

Author Comment

by:MilburnDrysdale
ID: 9701749
I've used the built-in DMX tools to set up  the connection. I created a system DSN in the ODBC adminstrator. You can then add that as an available "database" by selecting that DSN in a pull down menu, then create a recordset from that DSN (as you can see, I'm not a hand-coder). I am thinking this error is coming from the ODBC administrator and wondering if I should create a DSN-less connection where I can set the timeout. Any ideas on how to do this?
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9701773
Two things:

1) If you go to the DMX tools, browse for available connections, find the connection in question, then you should be able to find a properties tab where you can adjust the time out value.

2) I don't know that there is an OLEDB driver for that database. Let me take a look.

FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9701825
I haven't tested this (I can't) but this might work:


dim strConnectString  
dim objConnection

strConnectString = "Provider=IBMDA400;Data Source=" & SystemName & ";", "", ""

      set objConnection=Server.CreateObject("ADODB.Connection")
      objConnection.ConnectionTimeout = 15
      objConnection.CommandTimeout =  10
      objConnection.Mode = 3 'adModeReadWrite
      if objConnection.state = 0 then
            objConnection.Open strConnectString
      end if


Where system name is the name of your database.

FtB
0
 

Author Comment

by:MilburnDrysdale
ID: 9735378
Sorry for the late response (travelling this week)...I've tried all of the above and am still getting the same error message...
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9735421
So you were able to find the timeout propery of your connection object? If so, what did you set it to?

FtB
0
 

Author Comment

by:MilburnDrysdale
ID: 9735532
No...nothing in the ODBC administrator and nothing in DMX that I have found (poked around on their website,but found no references).
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 250 total points
ID: 9735794
That is where the answer lies. I would recommend a call to their tech support department to find out how to get at this.

FtB
0
 

Author Comment

by:MilburnDrysdale
ID: 9776483
Sorry for the late response...hope you guys don't mind if I split the points...never really found an answer with DMX, but not sure their is one...think this is more of a AS 400 issue...thanks for your help!
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9779354
Thank you and good luck!

FtB
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Bypass cross origin issues on development site 3 95
JS does not refresh 6 40
Send form to asp server side 6 27
JS to redirect to prev page 8 23
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

733 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