Export sp data to excel problem

M

Martin D

I have a procedure which runs the following command in MS Access 2007;

sp = "EXEC rsp_PropertyClass @CONTRACT='MA2',@PROPERTYCLASS=' All' "
DoCmd.OutputTo acOutputStoredProcedure, sp, acFormatXLS, , True

It fails to run and gives me a incorrect syntax error, but if I run EXEC
rsp_PropertyClass @CONTRACT='MA2',@PROPERTYCLASS=' All' on the sql server it
runs fine.

Why would this happen?
 
Top