Home Forums Programming General Retrieve data from SQL stored procedure in MS Excel RE: Retrieve data from SQL stored procedure in MS Excel

  • OK,

    Found it!!!

    I have just been following this thread because I have the same problem as the poster. I stripped my failing proc right down to doing nothing other than populating a #temp table, then selecting * from the #temp table. FAIL. Tried changing to a table variable. FAIL.

    Just selecting the records without putting them into the temp table works.

    Then I found this article - http://support.microsoft.com/kb/235340/en-us

    In a nutshell, after loading all the params into your cmd object, you stick...

    rst.ActiveConnection = cn

    rst.Open "SET NOCOUNT ON"

    *before* your Set rst = cmd.Execute() statement, and wullah! Problem solved. Pleeeeze tell me this works for you also.

    Cheers,

    Dave