Access 2K ADP Docmd Passing parm with acStoredProcedure

  • Thread starter Thread starter BJ Freeman
  • Start date Start date
B

BJ Freeman

DoCmd.OutputTo acStoredProcedure, "dbo.ADP_ExportinventoryBysupplier
13", "MicrosoftExcel(*.xls)", "mytest.xls", False, ""
when i look at it in the profiler is send this:
SELECT * FROM "dbo"."ADP_ExportinventoryBysupplier 13"

what is the correct syntax to get
Execute dbo.ADP_ExportinventoryBysupplier 13
 
I take it your sproc doesn't return a result set, but performs some
meaningful action involving an XL spreadsheet. In this case, ditch
DoCmd and execute the sproc on an ADO Command object. This method
supports both input and output parameters, which you can handle in
your code to find out if the sproc actually did what it was supposed
to do.

--Mary
 
all Sproc that use that docmdOutputTo return a result set that is then
exported to an excel. I use it a lot.
However the docmd seems to switch to Select in stead of Execute when an parm
is passed.
 
Well I worked out a solution.
I added a SP that sets the Supplier ID in a table. How this is implemented
is up to the programmer.
then the SP ADP_ExportinventoryBysupplier looks up that table, and get the
ID.
this way I don't have to pass the ID.
 
Back
Top