TedMosby
02-26-2009, 01:38 AM
I have a problem where I dont understand how it times out. When I have run the same SP in SQL Server it works fine.
Run-time error -2147217871 [Microsoft][SQL Native Client] Query timeout expired
This is the code I have.
Sub BuildUpdateData2()
Dim cnnDW As ADODB.Connection
Dim rsDW As ADODB.Recordset
Dim stProcName As String
Dim strSQLServer As String
strSQLServer = "Driver={SQL Native Client};" & _
"Server=CISSQL1;" & _
"Database=CORPINFO;" & _
"Trusted_Connection=Yes"
Set cnnDW = New ADODB.Connection
Application.ScreenUpdating = False
cnnDW.Open strSQLServer
Set rsDW = New ADODB.Recordset
stProcName = "EXEC dbo.sp_PARA_UpdateLkUp "
rsDW.CursorLocation = adUseClient
Debug.Print stProcName
rsDW.Open stProcName, cnnDW, adOpenDynamic, adLockOptimistic, adCmdText
Application.ScreenUpdating = False
cnnDW.Close
Set cnnDW = Nothing
Exit Sub
End Sub
Where have I gone wrong?
Run-time error -2147217871 [Microsoft][SQL Native Client] Query timeout expired
This is the code I have.
Sub BuildUpdateData2()
Dim cnnDW As ADODB.Connection
Dim rsDW As ADODB.Recordset
Dim stProcName As String
Dim strSQLServer As String
strSQLServer = "Driver={SQL Native Client};" & _
"Server=CISSQL1;" & _
"Database=CORPINFO;" & _
"Trusted_Connection=Yes"
Set cnnDW = New ADODB.Connection
Application.ScreenUpdating = False
cnnDW.Open strSQLServer
Set rsDW = New ADODB.Recordset
stProcName = "EXEC dbo.sp_PARA_UpdateLkUp "
rsDW.CursorLocation = adUseClient
Debug.Print stProcName
rsDW.Open stProcName, cnnDW, adOpenDynamic, adLockOptimistic, adCmdText
Application.ScreenUpdating = False
cnnDW.Close
Set cnnDW = Nothing
Exit Sub
End Sub
Where have I gone wrong?