Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Setting Currentproject.Connection.Commandtimeout

Posted on 2002-04-11
9
Medium Priority
?
1,307 Views
Last Modified: 2008-02-20
I have a report with the recordsource set to the name of a valid stored procedure.  I am assuming that in this situation, the connection that is used is currentproject.connection and that the timeout value for executing this report's recordsource is 30 seconds, the value of currentproject.connection.commandtimeout.

On an XP machine (using Office XP with SP1 applied), the report timeouts at 30 seconds.  On 95/98/Me machines (using Office 2000 with SR-2 applied), the report executes just fine and, by the way, takes longer than 30 seconds to run.

Is it possible to change the value of currentproject.connection.commandtimeout to 0 so I don't have to worry about this timeout?  I tried through code with no success.  Maybe there is another perspective to try ... help!  Thanks!
0
Comment
Question by:KKWohlgemuth
[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
9 Comments
 
LVL 3

Expert Comment

by:dapperry
ID: 6935224
The commandtimeout is read-only for open connections. Therefore, the CurrentProject.connection.commandtimeout will always be read-only. A couple of things you might want to consider:

1) I'm not sure if this is the same thing, but you can change the value of the connect timeout of the project by clicking on File | Connection... and then changing it in the Advanced tab of the dialog.

2) Of course you could always make a new connection, set the commandtimeout to 0, set the connectionstring to currentproject.connection.connectionstring, and then open the new connection object.

Hopefully, one of these suggestions will work for you.

:) dapperry
0
 

Author Comment

by:KKWohlgemuth
ID: 6935263
daperry,

Thanks for your suggestions...

1) This was one of the first things I played with.  It seems to me though, that this is simply a timeout for the project file trying to establish its connection with the identified SQL Server database.

2) This is along the lines of some things I pondered/tried.  But how can I set the reports and forms to use this new connection object?  There seems to be internal .adp connection and command objects that aren't exposed for developers like myself to modify except through Microsoft's interfaces within the project file environment.

Unless I am misunderstanding something, it appears my problem still lingers on ... thanks anyhow!
0
 

Author Comment

by:KKWohlgemuth
ID: 6935303
daperry,

Thanks for your suggestions...

1) This was one of the first things I played with.  It seems to me though, that this is simply a timeout for the project file trying to establish its connection with the identified SQL Server database.

2) This is along the lines of some things I pondered/tried.  But how can I set the reports and forms to use this new connection object?  There seems to be internal .adp connection and command objects that aren't exposed for developers like myself to modify except through Microsoft's interfaces within the project file environment.

Unless I am misunderstanding something, it appears my problem still lingers on ... thanks anyhow!
0
Technology Partners: 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 3

Expert Comment

by:dapperry
ID: 6936673
Hi,
      Try this bit of code, in your report open event:

Dim con As ADODB.Connection
Dim rst As ADODB.Recordset
Dim strSQL As String

con.ConnectionString = CurrentProject.Connection.ConnectionString
con.CommandTimeout = 0
con.Open

strSQL = "SELECT * FROM MyTable"
Set rst = con.Execute(strSQL)

Me.Recordset = rst

'Close up shop
Set rst = Nothing
Set con = Nothing

Haven't had time to test it, but it should work.

:) dapperry
0
 

Author Comment

by:KKWohlgemuth
ID: 6945704
dapperry, thanks again for your suggestion ... setting a report's recordset isn't allowed, unfortunately. In your above sample code, "me.recordset = rst" isn't a valid statement.
-----
Specifically, I want to change the "internal default connection's commandtimeout value" from it's current value of 30 to 0.
-----
Maybe there's a registry setting I could alter ... I don't know ... I need to find an answer!  I'm increasing the points to 500 ... Thanks in advance for any help!
0
 

Author Comment

by:KKWohlgemuth
ID: 6945733
whoops, can't exceed 300 points, sorry
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7103229
for KKWohlgemuth

No comment has been added for the last two months.
So it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
 - PAQ'd and pts refunded
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7129954
Per recommendation, points refunded and question closed.

Netminder
CS Moderator
0
 
LVL 3

Expert Comment

by:garyb2008
ID: 25159070
Its been a while for this question, but try setting OLE/DDE Timeout to 0 under tools/options
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

604 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