Sending parameters to stored procs

Sending parameters to stored procs

Post by Rob Oldfiel » Fri, 07 Dec 2001 02:32:26



Hi,

I'm attempting to run a stored procedure based on a value which I'm taking
from a form.  I can get it to work if the value I'm passing across is
integer, but I actually need to be passing text across.  More detail:

I have a combo called combo0.  The row source for this is the name of my
proc.

Procedure is:

Alter Procedure test

)
As
SELECT blah, blah, blah
return

...the proc works if I just run it manually and feed it the parameter.


..and I've also tried setting it via code with something like:


Combo0.Requery

...in the OnClick of a button.

If, however, I set the combo to show all the contents of the proc, it
doesn't seem to be getting passed the parameter.

Can anyone point out where I'm going wrong before I have to smash my
computer into a gazillion pieces?  Are there any examples of the use of
stored procedures anywhere?

Thanks

 
 
 

Sending parameters to stored procs

Post by Vadim Rap » Fri, 07 Dec 2001 15:40:05



of the form, not to the rowsource of your combo.

Vadim

 
 
 

Sending parameters to stored procs

Post by Rob Oldfiel » Fri, 07 Dec 2001 18:57:49


So why does it work if the value I'm passing is integer?  What's the
difference?



recordsource
> of the form, not to the rowsource of your combo.

> Vadim

 
 
 

Sending parameters to stored procs

Post by Paul » Fri, 07 Dec 2001 23:49:34


For characters, you should pass them with open and close single quote.
Hope this'll help


> So why does it work if the value I'm passing is integer?  What's the
> difference?




> recordsource
> > of the form, not to the rowsource of your combo.

> > Vadim

 
 
 

Sending parameters to stored procs

Post by D.Bucha » Sat, 26 Jan 2002 11:17:12


Examples of the use of passing parameters to stored procedures ? God, what
will you want next ?

The answer is in a Kbase article titled "Smashing your computer into a
gazillion pieces."

I have been trying to limit the list of values shown in a Combobox by a
"Like" query based on a
value in a text box. I looked at the Input Parameter method for an Sp but
the documentation from Messoft and internet searches was not enlightening.
What you have typed is more useful to me than that which those <censored> at
Microsoft provide.
There is an article about - wait for it - "ACC2002: How to use Parameterized
Combo Boves in an Access Project (Q281870)".
This might work as implemented but it doesn't where the combo box is on the
same form. A 2002 thing perhaps ?
I did come up with something, but I don't want to implement it - Web:
ElementK journals , Microsoft Office Developers Journal August 1998 -
Dynamically filling combo boxes by Patrick L. Steiner.

I'll be watching this thread with interest - meantime I have a PC to glue
back together.

DB


> Hi,

> I'm attempting to run a stored procedure based on a value which I'm taking
> from a form.  I can get it to work if the value I'm passing across is
> integer, but I actually need to be passing text across.  More detail:

> I have a combo called combo0.  The row source for this is the name of my
> proc.

> Procedure is:

> Alter Procedure test
> (

> )
> As
> SELECT blah, blah, blah
> return

> ...the proc works if I just run it manually and feed it the parameter.

> I have the Input Parameters of the form set up to be:

> ..and I've also tried setting it via code with something like:


> Combo0.Requery

> ...in the OnClick of a button.

> If, however, I set the combo to show all the contents of the proc, it
> doesn't seem to be getting passed the parameter.

> Can anyone point out where I'm going wrong before I have to smash my
> computer into a gazillion pieces?  Are there any examples of the use of
> stored procedures anywhere?

> Thanks

 
 
 

Sending parameters to stored procs

Post by Judith Art » Sun, 24 Feb 2002 23:55:37


Try putting it in the Validation Text propertie of the combo box


> Examples of the use of passing parameters to stored procedures ? God, what
> will you want next ?

> The answer is in a Kbase article titled "Smashing your computer into a
> gazillion pieces."

> I have been trying to limit the list of values shown in a Combobox by a
> "Like" query based on a
> value in a text box. I looked at the Input Parameter method for an Sp but
> the documentation from Messoft and internet searches was not enlightening.
> What you have typed is more useful to me than that which those <censored>
at
> Microsoft provide.
> There is an article about - wait for it - "ACC2002: How to use
Parameterized
> Combo Boves in an Access Project (Q281870)".
> This might work as implemented but it doesn't where the combo box is on
the
> same form. A 2002 thing perhaps ?
> I did come up with something, but I don't want to implement it - Web:
> ElementK journals , Microsoft Office Developers Journal August 1998 -
> Dynamically filling combo boxes by Patrick L. Steiner.

> I'll be watching this thread with interest - meantime I have a PC to glue
> back together.

> DB



> > Hi,

> > I'm attempting to run a stored procedure based on a value which I'm
taking
> > from a form.  I can get it to work if the value I'm passing across is
> > integer, but I actually need to be passing text across.  More detail:

> > I have a combo called combo0.  The row source for this is the name of my
> > proc.

> > Procedure is:

> > Alter Procedure test
> > (

> > )
> > As
> > SELECT blah, blah, blah
> > return

> > ...the proc works if I just run it manually and feed it the parameter.

> > I have the Input Parameters of the form set up to be:

> > ..and I've also tried setting it via code with something like:


> > Combo0.Requery

> > ...in the OnClick of a button.

> > If, however, I set the combo to show all the contents of the proc, it
> > doesn't seem to be getting passed the parameter.

> > Can anyone point out where I'm going wrong before I have to smash my
> > computer into a gazillion pieces?  Are there any examples of the use of
> > stored procedures anywhere?

> > Thanks

 
 
 

1. How to call an Oracle Stored procedure from MSSQL Server Stored Procedure

Anyone on this list know how to call an Oracle Stored procedure (a function
which returns a number) from within a Microsoft SQL Server stored procedure?

We are just using plain ODBC connections.  We have a function called func
and it takes 3 parameters, and returns a number.

The function is defined as:

func (str1, str2, str3) return NUMBER;

How, in SQL Server do I set up the three strings, then make the call, then
get the NUMBER.  I have seen a few articles on various web pages, but they
are primarily for procedures, not functions, and they use ADO.  I'm only
really interested in an ODBC  solution at the present time.

If you have any suggestions, or links, please email me at ericl at
broderbund dot com, or post your responses here.

Thanks!

2. is it possible to load indexes and other stuff into memory?

3. Call a stored procedure in another stored procedure

4. ODBC Driver patch

5. How to store images through stored procedures in SQL Server

6. VB drivers

7. Calling a stored proc within a stored proc

8. Books on stored procedures

9. Stored Procedure calling Stored Procedure

10. storing a value of a count in a variable within a stored procedure

11. Using Resultset in Stored Procedure in another stored procedure

12. Storing values in the Stored Procedures

13. How to call a stored Proc or Ext Stored proc /T-SQL UDF from VBScript