Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / SQL Server / ADP / May 2004

Tip: Looking for answers? Try searching our database.

Access 2K ADP Docmd Passing parm with acStoredProcedure

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BJ Freeman - 20 May 2004 14:11 GMT
   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
Mary Chipman - 20 May 2004 15:34 GMT
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

>    DoCmd.OutputTo acStoredProcedure, "dbo.ADP_ExportinventoryBysupplier
>13", "MicrosoftExcel(*.xls)", "mytest.xls", False, ""
[quoted text clipped - 3 lines]
>what is the correct syntax to get
>Execute dbo.ADP_ExportinventoryBysupplier 13
BJ Freeman - 20 May 2004 16:17 GMT
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.

> I take it your sproc doesn't return a result set, but performs some
> meaningful action involving an XL spreadsheet. In this case, ditch
[quoted text clipped - 12 lines]
> >what is the correct syntax to get
> >Execute dbo.ADP_ExportinventoryBysupplier 13
BJ Freeman - 24 May 2004 17:57 GMT
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.

>     DoCmd.OutputTo acStoredProcedure, "dbo.ADP_ExportinventoryBysupplier
> 13", "MicrosoftExcel(*.xls)", "mytest.xls", False, ""
[quoted text clipped - 3 lines]
> what is the correct syntax to get
> Execute dbo.ADP_ExportinventoryBysupplier 13
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.