I have a form in an Access 2000 ADP that has a stored procedure as its recordsource. How do I increase the timeout period before the stored procedure times out?
Public Sub RunSP()
With CurrentDb.CreateQueryDef("")
.Connect = "<valid ODBC connect string>"
.SQL = "EXEC StoredProcedure1"
.ODBCTimeout = 300 'Seconds
.ReturnsRecords = False
.Execute
End With
End Sub
Your post gave me an idea and this is the code I put in the Open event of my form to make it work:
Dim cmd1 As ADODB.Command
Dim strSQL As String
Dim rs1 As ADODB.Recordset
Set cmd1 = New ADODB.Command
strSQL = "spFindDuplicatesPMP"
With cmd1
.ActiveConnection = CurrentProject.Connection
.CommandType = adCmdStoredProc
.CommandText = strSQL
.CommandTimeout = 300
End With
End If
Set rs1 = cmd1.Execute
Set Me.Recordset = rs1
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.