Re: How do I execute a stored procedure

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Jeff,

passing 2 values to the stored procedure called myStoredProcedureName, this
is the quick and dirty way, you may want to setup a ADO connection and run
it from there.

CurrentProject.Connection.Execute "myStoredProcedureName " &
Me.Religion_ID.Value & ", 'Early'"

A tip, if you have a control on the form called pmyID and you have a
parameter within the stored procedure call @pmyID you should not have to
specify the parameter when calling the stored procedure from the form, as it
will be passed automatically into the stored procedure.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk

"Jeff Vila via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:2ff8904467534e8eb78dee7dc3cca52d@xxxxxxxxxxxxxxxxxxxx
>I have an Access Data Project (Access 2000) that links up to a SQL Server
> on the backend. I have a stored procedure on the SQL server that accepts
> two paramaters and then executes an update command. My question is how do
> I
> reference the stored procedure and pass it the two paramaters in my Visual
> Basic code. From what I understand I have to use ADO and create a public
> subroutine and then call that routine when I want to execute the stored
> procedure. Is there an easier method???? Any help is appeciated. Thanks,
>
> --
> Message posted via http://www.accessmonster.com


.



Relevant Pages

  • RE: Cannot obtain recordset from stored procedure that contains Ex
    ... I am guessing the extra messages issued by the Exec ... calls were either confusing the ADO connection or actually returning multiple ... >> call a stored procedure that stuffs records into another table using a SQL ... >> temp table in the stored procedure. ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL Locking Problem
    ... I am using CA with ADO connection + SQL2000. ... > I have a VFP8 application that calls a stored procedure that runs the ... > The query ofther users are running is a stored procedure call that runs ...
    (microsoft.public.fox.vfp.queries-sql)
  • MailMerge DataSource problem
    ... I have a DOT template which runs a ... In the macro, I have an ADO connection to get my ... because the stored procedure is probably not returning ...
    (microsoft.public.word.mailmerge.fields)
  • Slow server
    ... Within ADO Connection, a stored procedure that generates ... report took 30 seconds on MSDE2000, ... stored procedure on the same computer on SQL Server 2000 ...
    (microsoft.public.sqlserver.server)
  • SqlDataAdapter.Fill returns results of previous command
    ... This code executes successfully at certain points in the application, ... I don't know what the cause of this exception is yet, ... stored procedure was indeed executed on the database. ... The trace shows that the last action on the db was the stored ...
    (microsoft.public.dotnet.framework.adonet)