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 2005

Tip: Looking for answers? Try searching our database.

storedprocedure

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jerry - 31 May 2005 15:09 GMT
Hi everyone,
Can anyone help me

I just wanted to know if I can run a storedprocedure in a on click event
where the parameter automatically gets a value from a form
Every time the storedprocedure runs it asks for a parameter,that is what I
want to avoid.
James Goodman - 31 May 2005 15:36 GMT
Yes. You can read the value of the control & include this in the SQL
command.

How are you executing the SP?

e.g.
DoCmd.RunSQL "EXEC SomeSP('" & Me.ControlName & "')" 'For a text field.
DoCmd.RunSQL "EXEC SomeSP(" & Me.ControlName & ")" 'For a number field.

Signature

Cheers,

James Goodman

> Hi everyone,
> Can anyone help me
[quoted text clipped - 3 lines]
> Every time the storedprocedure runs it asks for a parameter,that is what I
> want to avoid.
jerry - 31 May 2005 15:56 GMT
when I use
DoCmd.RunSQL "EXEC SomeSP(" & Me.ControlName & ")" 'For a number field.
I`m getting a runtime error '170,

'DoCmd.RunSQL "exec dbo.SP_ADD_BETPAYOUT(" & Me.Combo10 & ")"' this is what
I wrote

> Yes. You can read the value of the control & include this in the SQL
> command.
[quoted text clipped - 16 lines]
> > Every time the storedprocedure runs it asks for a parameter,that is what I
> > want to avoid.
jerry - 31 May 2005 16:04 GMT
Thanks man,after reading your message again I got success,thanks a lot
Jerry

> when I use
> DoCmd.RunSQL "EXEC SomeSP(" & Me.ControlName & ")" 'For a number field.
[quoted text clipped - 24 lines]
> I
> > > want to avoid.
Norman Yuan - 31 May 2005 15:38 GMT
Naturally, if a stored procedure requires parameter(s), you need to supply
it(them) to run the SP. Simply write some code in Click event handler (click
event in what kind of program?) to "automatically" pass parameter(s) with
appropriate value(s) to the SP.

> Hi everyone,
> Can anyone help me
[quoted text clipped - 3 lines]
> Every time the storedprocedure runs it asks for a parameter,that is what I
> want to avoid.
 
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.