odbc timeout problem

Using DMX to create page that connects to our corp AS400 via ADO ODBC connection... here is the string that DMX created;


Set AIROUTBSHIP = Server.CreateObject("ADODB.Recordset")
AIROUTBSHIP.CursorType = 0
AIROUTBSHIP.CursorLocation = 2


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!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
YOu should be able do something like this:

      MM_LTL400TAF_ASP_STRING.ConnectionTimeout = 40

Fritz the Blank
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!
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

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:


MilburnDrysdaleAuthor Commented:
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?
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.

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.

MilburnDrysdaleAuthor Commented:
Sorry for the late response (travelling this week)...I've tried all of the above and am still getting the same error message...
So you were able to find the timeout propery of your connection object? If so, what did you set it to?

MilburnDrysdaleAuthor Commented:
No...nothing in the ODBC administrator and nothing in DMX that I have found (poked around on their website,but found no references).
That is where the answer lies. I would recommend a call to their tech support department to find out how to get at this.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MilburnDrysdaleAuthor Commented:
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!
Thank you and good luck!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.