K
Keith
We have many reports in an adp (wiht MS SQL 2005) that have code in them
that's similar to the following to create the dataset for the report (in the
OnOpen event):
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim sSql As String
sSql = "EXEC sp_RptWorkoutCounts '" _
& strGetParentAttyIDs & "', '" _
& Replace(strGetCounties, "'", "''''") & "', '" _
& Format(dteStartDate, "mm/dd/yyyy") & "', '" _
& Format(dteEndDate, "mm/dd/yyyy") & "'"
rs.Open sSql, cnnCurrProj, adOpenStatic
Me.RecordSource = rs.Source
DoCmd.Maximize
rs.Close
Problem is that one report is now timing out after 30 seconds. I know how to
set timeouts using the adodb command object when running for example a
stored procedure that adds a new row to a table, but this is different. The
code above is getting the source for the report and it's always worked
great. In fact I'm not sure how to use the other method for report data. So
anyway, my question is how do I set the timeout to say 2 minutes for the
above?
I thought I'd do this before the rs.Open line:
CurrentProject.Connection.CommandTimeout = 120
and then reset it to 30 after the report is done but that seems wrong to me.
Thanks,
Keith
that's similar to the following to create the dataset for the report (in the
OnOpen event):
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim sSql As String
sSql = "EXEC sp_RptWorkoutCounts '" _
& strGetParentAttyIDs & "', '" _
& Replace(strGetCounties, "'", "''''") & "', '" _
& Format(dteStartDate, "mm/dd/yyyy") & "', '" _
& Format(dteEndDate, "mm/dd/yyyy") & "'"
rs.Open sSql, cnnCurrProj, adOpenStatic
Me.RecordSource = rs.Source
DoCmd.Maximize
rs.Close
Problem is that one report is now timing out after 30 seconds. I know how to
set timeouts using the adodb command object when running for example a
stored procedure that adds a new row to a table, but this is different. The
code above is getting the source for the report and it's always worked
great. In fact I'm not sure how to use the other method for report data. So
anyway, my question is how do I set the timeout to say 2 minutes for the
above?
I thought I'd do this before the rs.Open line:
CurrentProject.Connection.CommandTimeout = 120
and then reset it to 30 after the report is done but that seems wrong to me.
Thanks,
Keith