Ok - I am calling a stored procedure that runs anywhere from 30 seconds to 6 minutes depending on what parameter the user enters. My problem is that when ever it runs for anything more than 35 seconds I get a runtime error for timeout expired. Here is my code:
Private Sub Command0_Click()
Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection
Dim rs As ADODB.Recordset
cnn.ConnectionTimeout = 4000
cnn.ConnectionString = "driver={SQL Server};" & _
"server=*&*^%*;uid=sa;pwd=&$%*%&;database=recall"
cnn.Open
Set rs = cnn.Execute("sp_recall_data_filter")
Set rs = cnn.Execute("Select count(*) from patient_waiting")
If rs(0) > 0 Then
MsgBox rs(0) & " rows were selected by your parameters"
Else
MsgBox "Sorry. No data extracted."
End If
' Close the connection.
cnn.Close
End Sub
As far as I know this is correct - but please let me know if there is a timout setting I can change or something..
Thanks,
Brian
Private Sub Command0_Click()
Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection
Dim rs As ADODB.Recordset
cnn.ConnectionTimeout = 4000
cnn.ConnectionString = "driver={SQL Server};" & _
"server=*&*^%*;uid=sa;pwd=&$%*%&;database=recall"
cnn.Open
Set rs = cnn.Execute("sp_recall_data_filter")
Set rs = cnn.Execute("Select count(*) from patient_waiting")
If rs(0) > 0 Then
MsgBox rs(0) & " rows were selected by your parameters"
Else
MsgBox "Sorry. No data extracted."
End If
' Close the connection.
cnn.Close
End Sub
As far as I know this is correct - but please let me know if there is a timout setting I can change or something..
Thanks,
Brian