I have some
VB code that for some strange reason takes forever to return records from a SQL database. I'm calling a stored procedure (which supposedly is a fast way to get records from a SQL database). The delay is encountered as soon as the line that first checks for EOF is reached. It doesn't appear to matter how many record are actually found as a result of the call to the stored procedure.
What's strange is that I can copy the command that contains the stored procedure call and paste it in SQL Server Query Analyzer and the results are returned almost instantly.
Dim SSQL As String
Dim rc As ADODB.Recordset
Dim Fullname As String
SSQL = "Exec [CurrentApproversByPC] '" & Me.CboPCs & "'"
Set rc = New ADODB.Recordset
With rc
.ActiveConnection = cnOnlineTimecard
.CursorLocation = adUseServer
.Source = SSQL
.Open
End With
Do While rc.EOF = False