I have successfully connected to my SQL Server db and now can run simple stored procedures and in-line SQL.
However, when I use the code below, which works for other Stored Procedures, to run a Stored Procedure to delete all the rows in a large table I receive a 'Timeout' error.
Checking ADO help I find that I can set a ConnectionTimeout parameter. I have tried this with no success.
Any ideas? ... heres my code...Thanks in anticipation
Private Sub Command4_Click()
'My example using ADO to execute a Stored Procedure
Dim ADOcnn1 As ADODB.Connection
Dim ADOCmd As New ADODB.Command
Dim objErr As ADODB.Error
On Error GoTo Myerr
'Open a connection using a DSN and ODBC tags.
Set ADOcnn1 = New ADODB.Connection
ADOcnn1.ConnectionString = "DSN=SQL123;UID=me;PWD=qwert;"
ADOcnn1.ConnectionTimeout = 180
'Check the state of the connection to ensure we are connected
If ADOcnn1.State = adStateOpen Then
'Set the Command object properties
Set ADOCmd.ActiveConnection = ADOcnn1
ADOCmd.CommandText = "uSP_Delete_Bang"
ADOCmd.CommandType = adCmdStoredProc
'Execute the Command object
Set ADOCmd = Nothing
Set ADOcnn1 = Nothing
'Display all errors
For Each objErr In ADOcnn1.Errors
MsgBox Error + " " + Str(Err)