Hi All
Trying to do something very simple. Run a query that has a parameter using code.
To run the query in QBE is fine taking very little time (so I can assume that all indexes etc are fine). But when i try to run the code below it works as expected but does a massive pause.
Dim cat As New ADOX.Catalog
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
cat.ActiveConnection = CurrentProject.Connection
Set cmd = cat.Procedures("qrySingleEquity".Command ' This takes AGES.
If Not (cmd Is Nothing) Then
cmd.Parameters("symbol".Value = strSymbol
Set rs = cmd.Execute
rs.MoveFirst
Debug.Print rs!Symbol
rs.Close
End If
Set cmd = Nothing
This is exactly the code I want to use -= but i have tried other ways of running the query in code (Set oRS = oConn.Execute(strSQL)) but it still runs VERY slowly although it does return the expected results.
Help!!
Stew